atests: Fix getting Windows system encoding on non-ASCII envs
@@ -17,7 +17,8 @@ DATADIR = normpath(join(dirname(abspath(__file__)), '..', 'testdata'))
SYSTEM_ENCODING = locale.getpreferredencoding(False)
# Python 3.6+ uses UTF-8 internally on Windows. We want real console encoding.
if os.name == 'nt':
- output = subprocess.check_output('chcp', shell=True, encoding='ASCII')
+ output = subprocess.check_output('chcp', shell=True, encoding='ASCII',
+ errors='ignore')
CONSOLE_ENCODING = 'cp' + output.split()[-1]
else:
CONSOLE_ENCODING = locale.getdefaultlocale()[-1]
