mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +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
|
@ -2,15 +2,16 @@
|
|||
# We don't test many operations on files other than
|
||||
# that their names can be used with Unicode characters.
|
||||
import os, glob, time, shutil
|
||||
import sys
|
||||
import unicodedata
|
||||
|
||||
import unittest
|
||||
from test.support import (run_unittest, rmtree, change_cwd,
|
||||
TESTFN_ENCODING, TESTFN_UNICODE, TESTFN_UNENCODABLE, create_empty_file)
|
||||
TESTFN_UNICODE, TESTFN_UNENCODABLE, create_empty_file)
|
||||
|
||||
if not os.path.supports_unicode_filenames:
|
||||
try:
|
||||
TESTFN_UNICODE.encode(TESTFN_ENCODING)
|
||||
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