Skip to content

Commit

Permalink
Prevent failure on the mac, where "mbcs" is not the file system
Browse files Browse the repository at this point in the history
encoding.  Use sys.getfilesystemencoding().
  • Loading branch information
mhammond committed Jul 16, 2003
1 parent 0bb242b commit bb4a47c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_pep277.py
Original file line number Diff line number Diff line change
@@ -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+"
Expand Down Expand Up @@ -79,7 +79,8 @@ def test_open(self):
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
Expand Down

0 comments on commit bb4a47c

Please sign in to comment.