mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
stringutils.py: tolerate sys.stdout having no 'encoding' attribute.
This commit is contained in:
parent
5ade4f82e0
commit
b8df25a8d1
@ -41,7 +41,9 @@ def _reload():
|
||||
|
||||
filesystem_encoding = _canonical_encoding(sys.getfilesystemencoding())
|
||||
|
||||
outenc = sys.stdout.encoding
|
||||
outenc = None
|
||||
if hasattr(sys.stdout, 'encoding'):
|
||||
outenc = sys.stdout.encoding
|
||||
if outenc is None:
|
||||
try:
|
||||
outenc = locale.getpreferredencoding()
|
||||
|
Loading…
x
Reference in New Issue
Block a user