diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2002-10-08 02:44:31 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2002-10-08 02:44:31 (GMT) |
commit | 8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df (patch) | |
tree | 1d688f1ea3f3b785a19760dd1477b796370c698d /Lib/test/test_pep277.py | |
parent | 20eae69a9fb5b5453f9ddf01600f99fd6ffffed7 (diff) | |
download | cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.zip cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.tar.gz cpython-8696ebcd28d38f74ee0ffa2cd82d9db1c0bad8df.tar.bz2 |
Add os.path.supports_unicode_filenames for all platforms,
sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink>
version), and fix test_pep277.py in a few minor ways.
Including doc and NEWS entries.
Diffstat (limited to 'Lib/test/test_pep277.py')
-rw-r--r-- | Lib/test/test_pep277.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 480fe00..9c4aa05 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -2,9 +2,7 @@ # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import os, unittest from test.test_support import TESTFN, TestSkipped, TestFailed, run_suite -try: - from nt import _getfullpathname -except ImportError: +if not os.path.supports_unicode_filenames: raise TestSkipped, "test works only on NT+" filenames = [ @@ -24,7 +22,8 @@ def deltree(dirname): # Don't hide legitimate errors: if one of these suckers exists, it's # an error if we can't remove it. if os.path.exists(dirname): - for fname in os.listdir(dirname): + # must pass unicode to os.listdir() so we get back unicode results. + for fname in os.listdir(unicode(dirname)): os.unlink(os.path.join(dirname, fname)) os.rmdir(dirname) @@ -99,7 +98,7 @@ class UnicodeFileTests(unittest.TestCase): f = open(filename, 'w') f.write((filename + '\n').encode("utf-8")) f.close() - print repr(_getfullpathname(filename)) + print repr(filename) os.remove(filename) os.chdir(oldwd) os.rmdir(dirname) |