This is a problem from the changes in r1234 (really), which blindly calls unicode() on all non-private attributes of an exception instance. If an exception has a non-ascii bytestring in its arguments, this exception will occur. Other objects that can't be stringified are also a potential issue.
The code is currently:
try:
return commands.run_bzr(argv)
except Exception, e:
d = {}
for key, val in e.__dict__.iteritems():
if not key.startswith('_'):
if not isinstance(val, unicode): val = unicode(val) d[key] = val
print "%s%s" % (SUB_ERROR, bencode.bencode((e.__class__.__name__, encode_unicode_escape(d))))
raise
Adding more try/catch is an option, or being more careful about accessing the exception instance.
This is a problem from the changes in r1234 (really), which blindly calls unicode() on all non-private attributes of an exception instance. If an exception has a non-ascii bytestring in its arguments, this exception will occur. Other objects that can't be stringified are also a potential issue.
The code is currently:
try: run_bzr( argv) _.iteritems( ): '_'):
val = unicode(val)
d[key] = val
bencode. bencode( (e.__class_ _.__name_ _,
encode_ unicode_ escape( d))))
return commands.
except Exception, e:
d = {}
for key, val in e.__dict_
if not key.startswith(
if not isinstance(val, unicode):
print "%s%s" % (SUB_ERROR,
raise
Adding more try/catch is an option, or being more careful about accessing the exception instance.