Index: Misc/NEWS =================================================================== --- Misc/NEWS (révision 81175) +++ Misc/NEWS (copie de travail) @@ -351,6 +351,10 @@ Library ------- +- Issue #8663: distutils.log emulates backslashreplace error handler. Fix + compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if + stdout is not a TTY). + - Issue #8681: Make the zlib module's error messages more informative when the zlib itself doesn't give any detailed explanation. Index: Lib/distutils/log.py =================================================================== --- Lib/distutils/log.py (révision 81175) +++ Lib/distutils/log.py (copie de travail) @@ -27,6 +27,10 @@ stream = sys.stderr else: stream = sys.stdout + if stream.errors == 'strict': + # emulate backslashreplace error handler + encoding = stream.encoding + msg = msg.encode(encoding, "backslashreplace").decode(encoding) stream.write('%s\n' % msg) stream.flush()