diff options
author | Guido van Rossum <guido@python.org> | 2007-10-26 04:29:23 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-10-26 04:29:23 (GMT) |
commit | c12a813aa7671ee12ccb79a70177a62bcefa2561 (patch) | |
tree | f6512593e7c4ed8211f2dd2c34c8676b5ed6301e /Lib/test/test_pep277.py | |
parent | daa251ca097e7f7382ed57c10efbbaddad103afb (diff) | |
download | cpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.zip cpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.tar.gz cpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.tar.bz2 |
Patch # 1331 by Christian Heimes.
The patch fixes some of the problems on Windows. It doesn't introduce
addition problems on Linux.
Diffstat (limited to 'Lib/test/test_pep277.py')
-rw-r--r-- | Lib/test/test_pep277.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 794de0d..554e011 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -36,7 +36,7 @@ class UnicodeFileTests(unittest.TestCase): except OSError: pass for name in self.files: - f = open(name, 'w') + f = open(name, 'wb') f.write((name+'\n').encode("utf-8")) f.close() os.stat(name) @@ -71,7 +71,7 @@ class UnicodeFileTests(unittest.TestCase): def test_open(self): for name in self.files: - f = open(name, 'w') + f = open(name, 'wb') f.write((name+'\n').encode("utf-8")) f.close() os.stat(name) @@ -80,7 +80,7 @@ class UnicodeFileTests(unittest.TestCase): f1 = os.listdir(test_support.TESTFN) # Printing f1 is not appropriate, as specific filenames # returned depend on the local encoding - f2 = os.listdir(str(test_support.TESTFN, + f2 = os.listdir(str(test_support.TESTFN.encode("utf-8"), sys.getfilesystemencoding())) f2.sort() print(f2) @@ -96,7 +96,7 @@ class UnicodeFileTests(unittest.TestCase): oldwd = os.getcwd() os.mkdir(dirname) os.chdir(dirname) - f = open(filename, 'w') + f = open(filename, 'wb') f.write((filename + '\n').encode("utf-8")) f.close() print(repr(filename)) |