Title: test_cmd_line fails with non-ascii path
Type: behavior Stage: needs patch
Components: Library (Lib), Tests Versions: Python 3.1, Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, vstinner
Priority: normal Keywords: patch

Created on 2009-12-30 21:44 by pitrou, last changed 2010-04-16 15:45 by vstinner. This issue is now closed.

File name Uploaded Description Edit
test_cmd_line.patch vstinner, 2010-04-16 15:00
Messages (3)
msg97062 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-12-30 21:44
I configured my buildbot to use a non-ascii path to the interpreter and
test_cmd_line fails as follows:

FAIL: test_large_PYTHONPATH (test.test_cmd_line.CmdLineTest)
Traceback (most recent call last):
line 181, in test_large_PYTHONPATH
    self.assertTrue(path1.encode('ascii') in stdout)
AssertionError: False is not True

msg103329 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 15:00
The problem is that the print is failing because Python uses ASCII encoding for stdout. Attached patch encodes sys.path to ASCII using backslashreplace to avoid the encoding issue.
msg103334 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-16 15:44
Fixed: r80116 (py3k), r80117 (3.1).
Date User Action Args
2010-04-16 15:45:30vstinnersetstatus: open -> closed
resolution: fixed
2010-04-16 15:44:59vstinnersetmessages: + msg103334
2010-04-16 15:00:11vstinnersetfiles: + test_cmd_line.patch

nosy: + vstinner
messages: + msg103329

keywords: + patch
2009-12-30 21:44:35pitroucreate