mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
Replace test.support.TESTFN_ENCODING with sys.getfilesystemencoding().
This commit is contained in:
parent
84ee7e1573
commit
24bddc1b3b
4 changed files with 10 additions and 14 deletions
|
@ -19,6 +19,7 @@ from io import BytesIO, StringIO
|
|||
import codecs
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
from urllib.error import URLError
|
||||
import urllib.request
|
||||
from test import support
|
||||
|
@ -35,7 +36,7 @@ except UnicodeEncodeError:
|
|||
supports_nonascii_filenames = True
|
||||
if not os.path.supports_unicode_filenames:
|
||||
try:
|
||||
support.TESTFN_UNICODE.encode(support.TESTFN_ENCODING)
|
||||
support.TESTFN_UNICODE.encode(sys.getfilesystemencoding())
|
||||
except (UnicodeError, TypeError):
|
||||
# Either the file system encoding is None, or the file name
|
||||
# cannot be encoded in the file system encoding.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue