The encoding of sys.stderr can exist and be None.
This commit is contained in:
2
main.py
2
main.py
@@ -45,7 +45,7 @@ def ReportError(script, e):
|
|||||||
# When the encoding of stderr is unknown (e.g. when redirected to a file),
|
# When the encoding of stderr is unknown (e.g. when redirected to a file),
|
||||||
# output will be encoded in UTF-8; otherwise the terminal's encoding will
|
# output will be encoded in UTF-8; otherwise the terminal's encoding will
|
||||||
# be used.
|
# be used.
|
||||||
enc = getattr(sys.stderr, 'encoding', 'utf8')
|
enc = getattr(sys.stderr, 'encoding', 'utf8') or 'utf8'
|
||||||
|
|
||||||
# Synchronize the UTF-8 encoded line with the output line in the
|
# Synchronize the UTF-8 encoded line with the output line in the
|
||||||
# terminal's encoding. We need to compensate for the fact that the
|
# terminal's encoding. We need to compensate for the fact that the
|
||||||
|
|||||||
Reference in New Issue
Block a user