summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2010-03-21 22:02:42 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2010-03-21 22:02:42 (GMT)
commite96ac3a33a154b454159c903cfcfcac5ed56215e (patch)
treed1d40adb030bafecaf679f7c9290a56d72254add /Lib/compileall.py
parent1d6af707cfac6406feb5c82656bb8f313bfcb696 (diff)
downloadcpython-e96ac3a33a154b454159c903cfcfcac5ed56215e.zip
cpython-e96ac3a33a154b454159c903cfcfcac5ed56215e.tar.gz
cpython-e96ac3a33a154b454159c903cfcfcac5ed56215e.tar.bz2
Merged revisions 78991-78992,78994 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78991 | martin.v.loewis | 2010-03-16 12:03:13 +0100 (Di, 16 Mär 2010) | 9 lines Merged revisions 78976 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78976 | martin.v.loewis | 2010-03-15 14:00:17 +0100 (Mo, 15 Mär 2010) | 1 line Issue #6716: Quote -x arguments of compileall in MSI installer. ........ ................ r78992 | martin.v.loewis | 2010-03-16 14:19:21 +0100 (Di, 16 Mär 2010) | 2 lines Issue #6716/2: Backslash-replace error output in compilall. ................ r78994 | martin.v.loewis | 2010-03-16 17:19:47 +0100 (Di, 16 Mär 2010) | 1 line Issue #6716/3: Exclude 2to3 tests from compileall. ................
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r--Lib/compileall.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 9451a60..2432842 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -77,7 +77,10 @@ def compile_dir(dir, maxlevels=10, ddir=None,
print('*** Error compiling', fullname, '...')
else:
print('*** ', end='')
- print(err.msg)
+ # escape non-printable characters in msg
+ msg = err.msg.encode(sys.stdout.encoding, 'backslashreplace')
+ msg = msg.decode(sys.stdout.encoding)
+ print(msg)
success = 0
except (SyntaxError, UnicodeError, IOError) as e:
if quiet: