Closed GoogleCodeExporter closed 8 years ago
In code I have not yet checked in I dealt with the issue like so:
report['Errors'].append('%s' % msg)
Which seems to work with just about any Python object. I don't know if that's
an accepted Python idiom, though...
Original comment by gregnea...@mac.com
on 13 Jan 2011 at 3:20
'%s' % msg
looks good to me:
http://docs.python.org/library/stdtypes.html#string-formatting
Perhaps even better:
u'%s' % msg
that should ensure that it is always unicode. Otherwise it will sometimes
return an ascii 'str' object and sometimes a 'unicode' object (depending on
whether msg is string or unicode or object).
Original comment by rrmiddleton@gmail.com
on 13 Jan 2011 at 4:08
Hmm - on second thoughts:
'%s' % msg
could still complain if msg is an object the is a tuple.
Whereas str(msg) or unicode(msg) should convert a tuple to a string
representation too.
That is you should be able to throw any object at unicode(msg) and not get an
exception.
Original comment by rrmiddleton@gmail.com
on 13 Jan 2011 at 4:10
Greg fixed this specific instance in r995. Any greater rework of unicode &
subprocess handling not until post 0.7.
Original comment by rrmiddleton@gmail.com
on 1 Mar 2011 at 11:01
Original issue reported on code.google.com by
rrmiddleton@gmail.com
on 13 Jan 2011 at 1:43