diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 15:10:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 15:10:27 (GMT) |
commit | 76cf68724cd92f15d3f081c173b1af928b3476dd (patch) | |
tree | 34a4e36f5ca2bd3aec2f7696f2e31b54bc4205a4 /Lib/test | |
parent | 89589c90fccf3f34639a83ed549778735df64748 (diff) | |
download | cpython-76cf68724cd92f15d3f081c173b1af928b3476dd.zip cpython-76cf68724cd92f15d3f081c173b1af928b3476dd.tar.gz cpython-76cf68724cd92f15d3f081c173b1af928b3476dd.tar.bz2 |
Issue #7605: Fix test_cmd_line if the current working directory is not ASCII
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_cmd_line.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index d68a5db..6688998 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -162,8 +162,15 @@ class CmdLineTest(unittest.TestCase): path1 = "ABCDE" * 100 path2 = "FGHIJ" * 100 env['PYTHONPATH'] = path1 + os.pathsep + path2 - p = _spawn_python_with_env('-S', '-c', - 'import sys; print(sys.path)') + + code = """ +import sys +path = ":".join(sys.path) +path = path.encode("ascii", "backslashreplace") +sys.stdout.buffer.write(path)""" + code = code.strip().splitlines() + code = '; '.join(code) + p = _spawn_python_with_env('-S', '-c', code) stdout, _ = p.communicate() self.assertIn(path1.encode('ascii'), stdout) self.assertIn(path2.encode('ascii'), stdout) |