From e58571b7eaa3f282d7d29f3aead1cc8220bec473 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 8 Sep 2016 11:11:13 -0700 Subject: Fixes tests broken by issue #27781. --- Lib/test/test_genericpath.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_genericpath.py') 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): -- cgit v1.2.1