Commit d51ba01f authored by Victor Stinner's avatar Victor Stinner

Issue #15478: Fix again to fix test_os on Windows

parent 62b3a45e
...@@ -654,7 +654,7 @@ TESTFN_UNDECODABLE = None ...@@ -654,7 +654,7 @@ TESTFN_UNDECODABLE = None
for name in (b'abc\xff', b'\xe7w\xf0'): for name in (b'abc\xff', b'\xe7w\xf0'):
try: try:
os.fsdecode(name) os.fsdecode(name)
except UnicodeDecodeErorr: except UnicodeDecodeError:
TESTFN_UNDECODABLE = name TESTFN_UNDECODABLE = name
break break
......
...@@ -2069,7 +2069,6 @@ class OSErrorTests(unittest.TestCase): ...@@ -2069,7 +2069,6 @@ class OSErrorTests(unittest.TestCase):
funcs = [ funcs = [
(os.chdir,), (os.chdir,),
(os.chmod, 0o777), (os.chmod, 0o777),
(os.lchown, 0, 0),
(os.listdir,), (os.listdir,),
(os.lstat,), (os.lstat,),
(os.open, os.O_RDONLY), (os.open, os.O_RDONLY),
...@@ -2077,15 +2076,19 @@ class OSErrorTests(unittest.TestCase): ...@@ -2077,15 +2076,19 @@ class OSErrorTests(unittest.TestCase):
(os.replace, "dst"), (os.replace, "dst"),
(os.rmdir,), (os.rmdir,),
(os.stat,), (os.stat,),
(os.truncate, 0),
(os.unlink,), (os.unlink,),
] ]
if hasattr(os, "chown"): if hasattr(os, "chown"):
funcs.append((os.chown, 0, 0)) 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": if sys.platform == "win32":
import nt
funcs.extend(( funcs.extend((
(os._getfullpathname,), (nt._getfullpathname,),
(os._isdir,), (nt._isdir,),
)) ))
if hasattr(os, "chflags"): if hasattr(os, "chflags"):
funcs.extend(( funcs.extend((
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment