diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-09-08 18:11:13 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-09-08 18:11:13 (GMT) |
commit | e58571b7eaa3f282d7d29f3aead1cc8220bec473 (patch) | |
tree | e43f9fd886b42d92ec4d6c544fe83e91eb6f27e8 /Lib/test/test_genericpath.py | |
parent | ee178e6d6ebcf28da8696c853cc9de5e3c0f15b4 (diff) | |
download | cpython-e58571b7eaa3f282d7d29f3aead1cc8220bec473.zip cpython-e58571b7eaa3f282d7d29f3aead1cc8220bec473.tar.gz cpython-e58571b7eaa3f282d7d29f3aead1cc8220bec473.tar.bz2 |
Fixes tests broken by issue #27781.
Diffstat (limited to 'Lib/test/test_genericpath.py')
-rw-r--r-- | Lib/test/test_genericpath.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index c8f158d..ae5dd6a 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -388,10 +388,13 @@ class CommonTest(GenericTest): warnings.simplefilter("ignore", DeprecationWarning) self.assertIn(b"foo", self.pathmodule.abspath(b"foo")) + # avoid UnicodeDecodeError on Windows + undecodable_path = b'' if sys.platform == 'win32' else b'f\xf2\xf2' + # Abspath returns bytes when the arg is bytes with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - for path in (b'', b'foo', b'f\xf2\xf2', b'/foo', b'C:\\'): + for path in (b'', b'foo', undecodable_path, b'/foo', b'C:\\'): self.assertIsInstance(self.pathmodule.abspath(path), bytes) def test_realpath(self): |