Issue #6716/2: Backslash-replace error output in compilall.

This commit is contained in:
Martin v. Löwis 2010-03-16 13:19:21 +00:00
parent 09c86afb1e
commit 4b00307425
3 changed files with 31 additions and 2 deletions

View file

@ -104,7 +104,10 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0):
print('*** Error compiling', fullname, '...')
else:
print('*** ', end='')
print(err.msg)
# escape non-printable characters in msg
msg = err.msg.encode(sys.stdout.encoding, errors='backslashreplace')
msg = msg.decode(sys.stdout.encoding)
print(msg)
success = 0
except (SyntaxError, UnicodeError, IOError) as e:
if quiet: