diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-05-28 14:24:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 14:24:39 (GMT) |
commit | 24bddc1b3b58f6899b2d412e51b37f68536e4fe2 (patch) | |
tree | c9960b0130a3a7f1b33e39371ffcd18037218320 /Lib/test/test_unicode_file.py | |
parent | 84ee7e1573d166fe7a9be676813e12523b62ab24 (diff) | |
download | cpython-24bddc1b3b58f6899b2d412e51b37f68536e4fe2.zip cpython-24bddc1b3b58f6899b2d412e51b37f68536e4fe2.tar.gz cpython-24bddc1b3b58f6899b2d412e51b37f68536e4fe2.tar.bz2 |
bpo-40275: Remove test.support.TESTFN_ENCODING (GH-20482)
Replace test.support.TESTFN_ENCODING with sys.getfilesystemencoding().
Diffstat (limited to 'Lib/test/test_unicode_file.py')
-rw-r--r-- | Lib/test/test_unicode_file.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index b16e4c5..ed1f6ce 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -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. |