mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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).
This commit is contained in:
parent
9ca9c25bcd
commit
2ca03c1f7f
2 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,10 @@ class Log:
|
||||||
stream = sys.stderr
|
stream = sys.stderr
|
||||||
else:
|
else:
|
||||||
stream = sys.stdout
|
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.write('%s\n' % msg)
|
||||||
stream.flush()
|
stream.flush()
|
||||||
|
|
||||||
|
|
|
@ -370,6 +370,10 @@ C-API
|
||||||
Library
|
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 #8513: os.get_exec_path() supports b'PATH' key and bytes value.
|
- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
|
||||||
subprocess.Popen() and os._execvpe() support bytes program name. Add
|
subprocess.Popen() and os._execvpe() support bytes program name. Add
|
||||||
os.supports_bytes_environ flag: True if the native OS type of the environment
|
os.supports_bytes_environ flag: True if the native OS type of the environment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue