From fa8ff34a6419b823a7ddef24120bb01347a598fb Mon Sep 17 00:00:00 2001 From: Andrew Malachowski <10599712-amalachowski@users.noreply.gitlab.com> Date: Thu, 1 Sep 2022 12:16:28 -0500 Subject: [PATCH] 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. --- waflib/Utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/waflib/Utils.py b/waflib/Utils.py index 669490ca..31618cb8 100644 --- a/waflib/Utils.py +++ b/waflib/Utils.py @@ -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')