]> granicus.if.org Git - python/commitdiff
Prevent failure on the mac, where "mbcs" is not the file system
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 16 Jul 2003 03:46:38 +0000 (03:46 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Wed, 16 Jul 2003 03:46:38 +0000 (03:46 +0000)
encoding.  Use sys.getfilesystemencoding().

Lib/test/test_pep277.py

index 9dc232c94b03d60bd32497794bf6bc14e86df0e7..744f4aaba1c8f72e91107d36c30c929c537043b1 100644 (file)
@@ -1,6 +1,6 @@
 # Test the Unicode versions of normal file functions
 # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
-import os, unittest
+import sys, os, unittest
 from test import test_support
 if not os.path.supports_unicode_filenames:
     raise test_support.TestSkipped, "test works only on NT+"
@@ -79,7 +79,8 @@ class UnicodeFileTests(unittest.TestCase):
     def test_listdir(self):
         f1 = os.listdir(test_support.TESTFN)
         f1.sort()
-        f2 = os.listdir(unicode(test_support.TESTFN,"mbcs"))
+        f2 = os.listdir(unicode(test_support.TESTFN,
+                                sys.getfilesystemencoding()))
         f2.sort()
         print f1
         print f2