Improve cp65001 compat in cpython < 3.3

This commit is contained in:
Andrew Malachowski 2022-09-01 21:39:45 +00:00 committed by Thomas Nagy
parent fae5693f41
commit f69602d1df
1 changed files with 2 additions and 0 deletions

View File

@ -452,6 +452,8 @@ def console_encoding():
pass
else:
if codepage:
if 65001 == codepage and sys.version_info < (3, 3):
return 'utf-8'
return 'cp%d' % codepage
return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1')