[Python-3000-checkins] r56625 - python/branches/py3k-struni/Lib/test/test_unicode_file.py

brett.cannon python-3000-checkins at python.org
Mon Jul 30 03:34:07 CEST 2007


Author: brett.cannon
Date: Mon Jul 30 03:34:07 2007
New Revision: 56625

Modified:
   python/branches/py3k-struni/Lib/test/test_unicode_file.py
Log:
Don't try to use a bytes sequence for file paths.  Also force equivalency tests
to be between str8 and str.


Modified: python/branches/py3k-struni/Lib/test/test_unicode_file.py
==============================================================================
--- python/branches/py3k-struni/Lib/test/test_unicode_file.py	(original)
+++ python/branches/py3k-struni/Lib/test/test_unicode_file.py	Mon Jul 30 03:34:07 2007
@@ -8,7 +8,8 @@
 from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
 from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE
 try:
-    TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING)
+    TESTFN_ENCODED = TESTFN_UNICODE
+    TESTFN_UNICODE.encode(TESTFN_ENCODING)
 except (UnicodeError, TypeError):
     # Either the file system encoding is None, or the file name
     # cannot be encoded in the file system encoding.
@@ -76,6 +77,7 @@
     # Do as many "equivalancy' tests as we can - ie, check that although we
     # have different types for the filename, they refer to the same file.
     def _do_equivilent(self, filename1, filename2):
+        filename2 = str8(filename2)
         # Note we only check "filename1 against filename2" - we don't bother
         # checking "filename2 against 1", as we assume we are called again with
         # the args reversed.


More information about the Python-3000-checkins mailing list