Skip to content

Commit 09c449c

Browse files
author
Victor Stinner
committed
Fix a typo: TESTFN_UNENCODEABLE => TESTFN_UNENCODABLE
1 parent 042b128 commit 09c449c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Lib/test/support.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -383,37 +383,37 @@ def fcmp(x, y): # fuzzy comparison function
383383
TESTFN_UNICODE = TESTFN + "-\xe0\xf2"
384384
TESTFN_ENCODING = sys.getfilesystemencoding()
385385

386-
# TESTFN_UNENCODEABLE is a filename (str type) that should *not* be able to be
386+
# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be
387387
# encoded by the filesystem encoding (in strict mode). It can be None if we
388388
# cannot generate such filename.
389389
if os.name in ('nt', 'ce'):
390390
if sys.getwindowsversion().platform < 2:
391391
# win32s (0) or Windows 9x/ME (1)
392-
TESTFN_UNENCODEABLE = None
392+
TESTFN_UNENCODABLE = None
393393
else:
394394
# Japanese characters (I think - from bug 846133)
395-
TESTFN_UNENCODEABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b"
395+
TESTFN_UNENCODABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b"
396396
try:
397-
TESTFN_UNENCODEABLE.encode(TESTFN_ENCODING)
397+
TESTFN_UNENCODABLE.encode(TESTFN_ENCODING)
398398
except UnicodeEncodeError:
399399
pass
400400
else:
401401
print('WARNING: The filename %r CAN be encoded by the filesystem encoding (%s). '
402402
'Unicode filename tests may not be effective'
403-
% (TESTFN_UNENCODEABLE, TESTFN_ENCODING))
404-
TESTFN_UNENCODEABLE = None
403+
% (TESTFN_UNENCODABLE, TESTFN_ENCODING))
404+
TESTFN_UNENCODABLE = None
405405
else:
406406
try:
407407
# ascii and utf-8 cannot encode the byte 0xff
408408
b'\xff'.decode(TESTFN_ENCODING)
409409
except UnicodeDecodeError:
410410
# 0xff will be encoded using the surrogate character u+DCFF
411-
TESTFN_UNENCODEABLE = TESTFN \
411+
TESTFN_UNENCODABLE = TESTFN \
412412
+ b'-\xff'.decode(TESTFN_ENCODING, 'surrogateescape')
413413
else:
414414
# File system encoding (eg. ISO-8859-* encodings) can encode
415415
# the byte 0xff. Skip some unicode filename tests.
416-
TESTFN_UNENCODEABLE = None
416+
TESTFN_UNENCODABLE = None
417417

418418
# Save the initial cwd
419419
SAVEDCWD = os.getcwd()

Lib/test/test_imp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ def cleanup():
307307

308308

309309
class NullImporterTests(unittest.TestCase):
310-
@unittest.skipIf(support.TESTFN_UNENCODEABLE is None,
310+
@unittest.skipIf(support.TESTFN_UNENCODABLE is None,
311311
"Need an undecodeable filename")
312312
def test_unencodeable(self):
313-
name = support.TESTFN_UNENCODEABLE
313+
name = support.TESTFN_UNENCODABLE
314314
os.mkdir(name)
315315
try:
316316
self.assertRaises(ImportError, imp.NullImporter, name)

Lib/test/test_unicode_file.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import unittest
88
from test.support import (run_unittest, rmtree,
9-
TESTFN_ENCODING, TESTFN_UNICODE, TESTFN_UNENCODEABLE)
9+
TESTFN_ENCODING, TESTFN_UNICODE, TESTFN_UNENCODABLE)
1010

1111
try:
1212
TESTFN_UNICODE.encode(TESTFN_ENCODING)
@@ -147,8 +147,8 @@ def _test_equivalent(self, filename1, filename2):
147147
# _test functions with each of the filename combinations we wish to test
148148
def test_single_files(self):
149149
self._test_single(TESTFN_UNICODE)
150-
if TESTFN_UNENCODEABLE is not None:
151-
self._test_single(TESTFN_UNENCODEABLE)
150+
if TESTFN_UNENCODABLE is not None:
151+
self._test_single(TESTFN_UNENCODABLE)
152152

153153
def test_directories(self):
154154
# For all 'equivalent' combinations:
@@ -157,9 +157,9 @@ def test_directories(self):
157157
ext = ".dir"
158158
self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False)
159159
# Our directory name that can't use a non-unicode name.
160-
if TESTFN_UNENCODEABLE is not None:
161-
self._do_directory(TESTFN_UNENCODEABLE+ext,
162-
TESTFN_UNENCODEABLE+ext,
160+
if TESTFN_UNENCODABLE is not None:
161+
self._do_directory(TESTFN_UNENCODABLE+ext,
162+
TESTFN_UNENCODABLE+ext,
163163
False)
164164

165165
def test_main():

0 commit comments

Comments
 (0)