[Python-checkins] cpython: Issue #15478: Fix again to fix test_os on Windows

victor.stinner python-checkins at python.org
Wed Oct 31 22:25:39 CET 2012


http://hg.python.org/cpython/rev/9f696742dbda
changeset:   80138:9f696742dbda
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Oct 31 22:16:38 2012 +0100
summary:
  Issue #15478: Fix again to fix test_os on Windows

files:
  Lib/test/support.py |   2 +-
  Lib/test/test_os.py |  11 +++++++----
  2 files changed, 8 insertions(+), 5 deletions(-)


diff --git a/Lib/test/support.py b/Lib/test/support.py
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -654,7 +654,7 @@
 for name in (b'abc\xff', b'\xe7w\xf0'):
     try:
         os.fsdecode(name)
-    except UnicodeDecodeErorr:
+    except UnicodeDecodeError:
         TESTFN_UNDECODABLE = name
         break
 
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -2069,7 +2069,6 @@
         funcs = [
             (os.chdir,),
             (os.chmod, 0o777),
-            (os.lchown, 0, 0),
             (os.listdir,),
             (os.lstat,),
             (os.open, os.O_RDONLY),
@@ -2077,15 +2076,19 @@
             (os.replace, "dst"),
             (os.rmdir,),
             (os.stat,),
-            (os.truncate, 0),
             (os.unlink,),
         ]
         if hasattr(os, "chown"):
             funcs.append((os.chown, 0, 0))
+        if hasattr(os, "lchown"):
+            funcs.append((os.lchown, 0, 0))
+        if hasattr(os, "truncate"):
+            funcs.append((os.truncate, 0))
         if sys.platform == "win32":
+            import nt
             funcs.extend((
-                (os._getfullpathname,),
-                (os._isdir,),
+                (nt._getfullpathname,),
+                (nt._isdir,),
             ))
         if hasattr(os, "chflags"):
             funcs.extend((

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list