From 0f77bf27ca372655104884bf1e1ecaf014e8a61a Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 3 Nov 2012 14:37:37 +0200 Subject: [PATCH] Issue #16218: skip test if filesystem doesn't support required encoding --- Lib/test/test_cmd_line_script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 6dca6f0a66d..86dfc733c11 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -366,7 +366,12 @@ class CmdLineTest(unittest.TestCase): def test_non_utf8(self): # Issue #16218 with temp_dir() as script_dir: - script_basename = '\udcf1\udcea\udcf0\udce8\udcef\udcf2' + script_basename = '\u0441\u043a\u0440\u0438\u043f\u0442' + try: + script_basename.encode(sys.getfilesystemencoding()) + except UnicodeEncodeError: + raise unittest.SkipTest("Filesystem doesn't support " + "unicode names") source = 'print("test output")\n' script_name = _make_test_script(script_dir, script_basename, source) if not __debug__: