mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 23:43:31 +01:00
Remove handling of mbcs encoding
This has been phased out in Python 3.6. https://peps.python.org/pep-0529/
This commit is contained in:
parent
4fcb148d60
commit
5826d6b59b
2 changed files with 2 additions and 21 deletions
|
|
@ -19,7 +19,6 @@ import os.path
|
|||
import re
|
||||
import shutil
|
||||
import stat
|
||||
import sys
|
||||
import time
|
||||
import unicodedata
|
||||
import unittest
|
||||
|
|
@ -423,19 +422,6 @@ class DestinationTest(BeetsTestCase):
|
|||
dest = self.i.destination(relative_to_libdir=True)
|
||||
assert as_string(dest) == unicodedata.normalize("NFC", instr)
|
||||
|
||||
def test_non_mbcs_characters_on_windows(self):
|
||||
oldfunc = sys.getfilesystemencoding
|
||||
sys.getfilesystemencoding = lambda: "mbcs"
|
||||
try:
|
||||
self.i.title = "h\u0259d"
|
||||
self.lib.path_formats = [("default", "$title")]
|
||||
p = self.i.destination()
|
||||
assert b"?" not in p
|
||||
# We use UTF-8 to encode Windows paths now.
|
||||
assert "h\u0259d".encode() in p
|
||||
finally:
|
||||
sys.getfilesystemencoding = oldfunc
|
||||
|
||||
def test_unicode_extension_in_fragment(self):
|
||||
self.lib.path_formats = [("default", "foo")]
|
||||
self.i.path = util.bytestring_path("bar.caf\xe9")
|
||||
|
|
|
|||
|
|
@ -156,13 +156,8 @@ class PathConversionTest(BeetsTestCase):
|
|||
assert path == outpath
|
||||
|
||||
def _windows_bytestring_path(self, path):
|
||||
old_gfse = sys.getfilesystemencoding
|
||||
sys.getfilesystemencoding = lambda: "mbcs"
|
||||
try:
|
||||
with _common.platform_windows():
|
||||
return util.bytestring_path(path)
|
||||
finally:
|
||||
sys.getfilesystemencoding = old_gfse
|
||||
with _common.platform_windows():
|
||||
return util.bytestring_path(path)
|
||||
|
||||
def test_bytestring_path_windows_encodes_utf8(self):
|
||||
path = "caf\xe9"
|
||||
|
|
|
|||
Loading…
Reference in a new issue