From cc676a0d7f683888e658925e2b622e4b88e35605 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 10 Sep 2010 11:24:10 +0000 Subject: [PATCH] Recorded merge of revisions 83987 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ........ r83987 | victor.stinner | 2010-08-14 00:23:24 +0200 (sam., 14 août 2010) | 2 lines Fix a typo: TESTFN_UNENCODEABLE => TESTFN_UNENCODABLE ........ --- Lib/test/test_support.py | 10 +++++----- Lib/test/test_unicode_file.py | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 744b9d5927c..970b884b6c3 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -361,30 +361,30 @@ else: # 2 latin characters. TESTFN_UNICODE = unicode("@test-\xe0\xf2", "latin-1") TESTFN_ENCODING = sys.getfilesystemencoding() - # TESTFN_UNICODE_UNENCODEABLE is a filename that should *not* be + # TESTFN_UNENCODABLE is a filename that should *not* be # able to be encoded by *either* the default or filesystem encoding. # This test really only makes sense on Windows NT platforms # which have special Unicode support in posixmodule. if (not hasattr(sys, "getwindowsversion") or sys.getwindowsversion()[3] < 2): # 0=win32s or 1=9x/ME - TESTFN_UNICODE_UNENCODEABLE = None + TESTFN_UNENCODABLE = None else: # Japanese characters (I think - from bug 846133) - TESTFN_UNICODE_UNENCODEABLE = eval('u"@test-\u5171\u6709\u3055\u308c\u308b"') + TESTFN_UNENCODABLE = eval('u"@test-\u5171\u6709\u3055\u308c\u308b"') try: # XXX - Note - should be using TESTFN_ENCODING here - but for # Windows, "mbcs" currently always operates as if in # errors=ignore' mode - hence we get '?' characters rather than # the exception. 'Latin1' operates as we expect - ie, fails. # See [ 850997 ] mbcs encoding ignores errors - TESTFN_UNICODE_UNENCODEABLE.encode("Latin1") + TESTFN_UNENCODABLE.encode("Latin1") except UnicodeEncodeError: pass else: print \ 'WARNING: The filename %r CAN be encoded by the filesystem. ' \ 'Unicode filename tests may not be effective' \ - % TESTFN_UNICODE_UNENCODEABLE + % TESTFN_UNENCODABLE # Disambiguate TESTFN for parallel testing, while letting it remain a valid diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index dcd4a36d9ba..f04bad39642 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -6,7 +6,7 @@ import unicodedata import unittest from test.test_support import run_unittest, TESTFN_UNICODE -from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE +from test.test_support import TESTFN_ENCODING, TESTFN_UNENCODABLE try: TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING) except (UnicodeError, TypeError): @@ -171,8 +171,8 @@ class TestUnicodeFiles(unittest.TestCase): def test_single_files(self): self._test_single(TESTFN_ENCODED) self._test_single(TESTFN_UNICODE) - if TESTFN_UNICODE_UNENCODEABLE is not None: - self._test_single(TESTFN_UNICODE_UNENCODEABLE) + if TESTFN_UNENCODABLE is not None: + self._test_single(TESTFN_UNENCODABLE) def test_equivalent_files(self): self._test_equivalent(TESTFN_ENCODED, TESTFN_UNICODE) @@ -188,9 +188,9 @@ class TestUnicodeFiles(unittest.TestCase): self._do_directory(TESTFN_UNICODE+ext, TESTFN_ENCODED+ext, False) self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False) # Our directory name that can't use a non-unicode name. - if TESTFN_UNICODE_UNENCODEABLE is not None: - self._do_directory(TESTFN_UNICODE_UNENCODEABLE+ext, - TESTFN_UNICODE_UNENCODEABLE+ext, + if TESTFN_UNENCODABLE is not None: + self._do_directory(TESTFN_UNENCODABLE+ext, + TESTFN_UNENCODABLE+ext, False) def test_main():