Avoid UnicodeEncodeError exception on exception
When an exception message contained a non-ascii character, the str() conversion raised an UnicodeEncodeError. Avoid this by simply passing the message itself. Python handles the encoding to locale already. Change-Id: I3c4440fc238d8c8136a9bd93a0040668f82bda6e
This commit is contained in:
@@ -489,7 +489,7 @@ def main():
|
|||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.debug(e, exc_info=1)
|
logger.debug(e, exc_info=1)
|
||||||
print >> sys.stderr, "ERROR: %s" % str(e)
|
print >> sys.stderr, "ERROR: %s" % e.message
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user