Issue #9425: skip tests if a filename is not encodable
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index eb5d877..244874d 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -509,8 +509,10 @@
p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
self.assertEqual(p.returncode, 1)
- self.assert_(b"UnicodeEncodeError:" in stderr,
- "%r not in %s" % (b"UniodeEncodeError:", ascii(stderr)))
+ self.assertIn(
+ br"UnicodeEncodeError: 'utf-8' codec can't encode character "
+ br"'\udcff' in position 7: surrogates not allowed",
+ stderr)
def test_sys_flags(self):
self.assertTrue(sys.flags)