mirror of https://gitlab.com/ita1024/waf.git
Utils: Add python2 cp65001 compat
git-bash ptty on Windows uses cp65001 by default. Attempting to decode this codepage in cpython < 3.3 will fail as the encoding is unsupported. cp65001 is an alias for utf8 on Windows and is implemented as such since cpython > 3.8. Use this to provide minimal compatibility for cp65001 to waf running under python2.
This commit is contained in:
parent
c9929238ee
commit
fa8ff34a64
|
@ -452,6 +452,8 @@ def console_encoding():
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if codepage:
|
if codepage:
|
||||||
|
if 65001 == codepage and sys.version_info < (3, 3):
|
||||||
|
return 'utf-8'
|
||||||
return 'cp%d' % codepage
|
return 'cp%d' % codepage
|
||||||
return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1')
|
return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue