mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #6716/2: Backslash-replace error output in compilall.
This commit is contained in:
parent
09c86afb1e
commit
4b00307425
3 changed files with 31 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue