diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 15:44:04 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-16 15:44:04 (GMT) |
commit | 30ba25b8659119c2281e1e4046fb5ddf48c69d8a (patch) | |
tree | 004efd78d71997eeb723ce758d212b1ca3d0e9cf /Lib/test/test_cmd_line.py | |
parent | ec51d03e61af4dfa7beda8b8f53f4824c131600a (diff) | |
download | cpython-30ba25b8659119c2281e1e4046fb5ddf48c69d8a.zip cpython-30ba25b8659119c2281e1e4046fb5ddf48c69d8a.tar.gz cpython-30ba25b8659119c2281e1e4046fb5ddf48c69d8a.tar.bz2 |
Merged revisions 80116 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r80116 | victor.stinner | 2010-04-16 17:10:27 +0200 (ven., 16 avril 2010) | 2 lines
Issue #7605: Fix test_cmd_line if the current working directory is not ASCII
........
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 87ae2b6..5143ed7 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -176,7 +176,15 @@ class CmdLineTest(unittest.TestCase): path1 = "ABCDE" * 100 path2 = "FGHIJ" * 100 env['PYTHONPATH'] = path1 + os.pathsep + path2 - p = _spawn_python('-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('-S', '-c', code) stdout, _ = p.communicate() self.assertTrue(path1.encode('ascii') in stdout) self.assertTrue(path2.encode('ascii') in stdout) |