bpo-34421 avoid unicode error in distutils logging (GH-8799)
This caused installation errors in some cases on Windows. Patch by Julien Malard.
This commit is contained in:
parent
d700f97b62
commit
0afada163c
|
@ -31,7 +31,10 @@ class Log:
|
|||
# emulate backslashreplace error handler
|
||||
encoding = stream.encoding
|
||||
msg = msg.encode(encoding, "backslashreplace").decode(encoding)
|
||||
stream.write('%s\n' % msg)
|
||||
try:
|
||||
stream.write('%s\n' % msg)
|
||||
except UnicodeEncodeError:
|
||||
stream.write('%s\n' % msg.encode('unicode-escape').decode('ascii'))
|
||||
stream.flush()
|
||||
|
||||
def log(self, level, msg, *args):
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix distutils logging for non-ASCII strings. This caused installation issues on Windows.
|
Loading…
Reference in New Issue