On 19 June 2012 21:46, Robert Collins <email address hidden> wrote:
...
> (assuming msg is a unicode object, not a bytestring). If msg is a
> bytestring, then:
> if msg:
> details['STDOUT:'] = content.Content(content_type.UTF8_TEXT, lambda:[msg])
This will keep a reference to msg in the enclosing scope. A quick look
at the code shows that msg is changed later in the function, so this
will break, hence the need for the partial() I think.
On 19 June 2012 21:46, Robert Collins <email address hidden> wrote: Content( content_ type.UTF8_ TEXT, lambda:[msg])
...
> (assuming msg is a unicode object, not a bytestring). If msg is a
> bytestring, then:
> if msg:
> details['STDOUT:'] = content.
This will keep a reference to msg in the enclosing scope. A quick look
at the code shows that msg is changed later in the function, so this
will break, hence the need for the partial() I think.