Skip to content

Commit 5826d6b

Browse files
committed
Remove handling of mbcs encoding
This has been phased out in Python 3.6. https://peps.python.org/pep-0529/
1 parent 4fcb148 commit 5826d6b

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

test/test_library.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import re
2020
import shutil
2121
import stat
22-
import sys
2322
import time
2423
import unicodedata
2524
import unittest
@@ -423,19 +422,6 @@ def test_unicode_normalized_nfc_on_linux(self):
423422
dest = self.i.destination(relative_to_libdir=True)
424423
assert as_string(dest) == unicodedata.normalize("NFC", instr)
425424

426-
def test_non_mbcs_characters_on_windows(self):
427-
oldfunc = sys.getfilesystemencoding
428-
sys.getfilesystemencoding = lambda: "mbcs"
429-
try:
430-
self.i.title = "h\u0259d"
431-
self.lib.path_formats = [("default", "$title")]
432-
p = self.i.destination()
433-
assert b"?" not in p
434-
# We use UTF-8 to encode Windows paths now.
435-
assert "h\u0259d".encode() in p
436-
finally:
437-
sys.getfilesystemencoding = oldfunc
438-
439425
def test_unicode_extension_in_fragment(self):
440426
self.lib.path_formats = [("default", "foo")]
441427
self.i.path = util.bytestring_path("bar.caf\xe9")

test/test_util.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,8 @@ def test_syspath_posix_unchanged(self):
156156
assert path == outpath
157157

158158
def _windows_bytestring_path(self, path):
159-
old_gfse = sys.getfilesystemencoding
160-
sys.getfilesystemencoding = lambda: "mbcs"
161-
try:
162-
with _common.platform_windows():
163-
return util.bytestring_path(path)
164-
finally:
165-
sys.getfilesystemencoding = old_gfse
159+
with _common.platform_windows():
160+
return util.bytestring_path(path)
166161

167162
def test_bytestring_path_windows_encodes_utf8(self):
168163
path = "caf\xe9"

0 commit comments

Comments
 (0)