diff options
author | native-api <ivan_pozdeev@mail.ru> | 2018-12-06 07:04:35 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-06 07:04:35 (GMT) |
commit | 8752dfbd1f0c96ca09cdacabaf0d0f8c3895b6ce (patch) | |
tree | 74bbe7f9a7c19e9a66586d3f2f08fe0bc4d3eebf | |
parent | 6ea9d54dea9f2f8be7fe6d284064c579331388a9 (diff) | |
download | cpython-8752dfbd1f0c96ca09cdacabaf0d0f8c3895b6ce.zip cpython-8752dfbd1f0c96ca09cdacabaf0d0f8c3895b6ce.tar.gz cpython-8752dfbd1f0c96ca09cdacabaf0d0f8c3895b6ce.tar.bz2 |
bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)
-rw-r--r-- | Lib/test/support/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f90212c..05e8593 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -871,7 +871,11 @@ for character in ( '\u20AC', ): try: - os.fsdecode(os.fsencode(character)) + # If Python is set up to use the legacy 'mbcs' in Windows, + # 'replace' error mode is used, and encode() returns b'?' + # for characters missing in the ANSI codepage + if os.fsdecode(os.fsencode(character)) != character: + raise UnicodeError except UnicodeError: pass else: |