]> granicus.if.org Git - python/commitdiff
Issue #15478: Fix again to fix test_os on Windows
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 31 Oct 2012 21:16:38 +0000 (22:16 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 31 Oct 2012 21:16:38 +0000 (22:16 +0100)
Lib/test/support.py
Lib/test/test_os.py

index 1717c0690b97ab3e4a05301b9e2dcea45d984b5e..93b94d990f15810d17dd0a92cda5aec23ecea062 100644 (file)
@@ -654,7 +654,7 @@ TESTFN_UNDECODABLE = None
 for name in (b'abc\xff', b'\xe7w\xf0'):
     try:
         os.fsdecode(name)
-    except UnicodeDecodeErorr:
+    except UnicodeDecodeError:
         TESTFN_UNDECODABLE = name
         break
 
index a4cf60fed4ba04d97df80edb64d923ae2f0ce5d0..42a1d00eaaf706e4ecfa82fbaffa53a7a8ec77e1 100644 (file)
@@ -2069,7 +2069,6 @@ class OSErrorTests(unittest.TestCase):
         funcs = [
             (os.chdir,),
             (os.chmod, 0o777),
-            (os.lchown, 0, 0),
             (os.listdir,),
             (os.lstat,),
             (os.open, os.O_RDONLY),
@@ -2077,15 +2076,19 @@ class OSErrorTests(unittest.TestCase):
             (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((