summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2003-07-16 03:46:38 (GMT)
committerMark Hammond <mhammond@skippinet.com.au>2003-07-16 03:46:38 (GMT)
commitbb4a47c818c259c6542c85ccde2dc95baba41f07 (patch)
treed006a2b602b6c24e59ecf5f005d0b37ddb0310b3
parent0bb242b67cfe08587bf5cb722d18088fcba0fba7 (diff)
downloadcpython-bb4a47c818c259c6542c85ccde2dc95baba41f07.zip
cpython-bb4a47c818c259c6542c85ccde2dc95baba41f07.tar.gz
cpython-bb4a47c818c259c6542c85ccde2dc95baba41f07.tar.bz2
Prevent failure on the mac, where "mbcs" is not the file system
encoding. Use sys.getfilesystemencoding().
-rw-r--r--Lib/test/test_pep277.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index 9dc232c..744f4aa 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -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