summaryrefslogtreecommitdiff
path: root/Lib/test/test_genericpath.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-09-08 11:11:13 -0700
committerSteve Dower <steve.dower@microsoft.com>2016-09-08 11:11:13 -0700
commite58571b7eaa3f282d7d29f3aead1cc8220bec473 (patch)
treee43f9fd886b42d92ec4d6c544fe83e91eb6f27e8 /Lib/test/test_genericpath.py
parentee178e6d6ebcf28da8696c853cc9de5e3c0f15b4 (diff)
downloadcpython-git-e58571b7eaa3f282d7d29f3aead1cc8220bec473.tar.gz
Fixes tests broken by issue #27781.
Diffstat (limited to 'Lib/test/test_genericpath.py')
-rw-r--r--Lib/test/test_genericpath.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index c8f158d0c5..ae5dd6a5f7 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):