diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-19 17:00:07 +0000 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-19 17:00:07 +0000 |
| commit | b78e3623ca34400e29297da0409211a7d83728c6 (patch) | |
| tree | 803c6ae8f14b164deece97305dc7eeac0f1b6f6b | |
| parent | a99ff5b39025ea4dc8a72f9e7f1d51a17f1aacdc (diff) | |
| download | python-setuptools-git-b78e3623ca34400e29297da0409211a7d83728c6.tar.gz | |
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).
| -rw-r--r-- | log.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -27,6 +27,10 @@ class Log: 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() |
