[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-20 Thread Martin v . Löwis
Martin v. Löwis added the comment: Amaury, I fail to see how the error you get on Windows is related to this issue. AFAICT, neither the issue nor the patch affects Windows at all. Closing the issue as fixed. If you think there is also an issue on Windows, please submit a new bug report. Howe

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: "mbcs" is not a fixed encoding and may change between Windows sessions, see the Rationale in PEP277 http://www.python.org/dev/peps/pep-0277/ The mixed case is interesting. We could use CreateProcessW when at least one string is Unicode, and CreateProces

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread STINNER Victor
STINNER Victor added the comment: > PEP 277 explicitly states that unicode strings should be passed to > wide-character functions, whereas byte strings use "standard" > functions. This is done in posixmodule.c, for example. CreateProcessW takes a lot of arguments. Should we CreateProcessA or

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PEP 277 explicitly states that unicode strings should be passed to wide-character functions, whereas byte strings use "standard" functions. This is done in posixmodule.c, for example. The "current locale" is a moving thing. -- _

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread STINNER Victor
STINNER Victor added the comment: > It does not work on Windows I always consider Windows as a special case because Windows uses unicode internally. Byte string are converted quickly to unicode using the current locale. My patch was for UNIX/BSD which uses byte string internally. sp_CreateP

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread STINNER Victor
STINNER Victor added the comment: > And please add unit tests... I'm thinking on this. I plan to write tests for all my last changes about surrogates. -- ___ Python tracker ___

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It does not work on Windows: >>> subprocess.Popen("c:/windows/notepad.exe", cwd=b'c:/temp') Traceback (most recent call last): File "", line 1, in File "D:\afa\python\py3k-1\lib\subprocess.py", line 681, in __init__ restore_signals, start_new_ses

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-16 Thread STINNER Victor
STINNER Victor added the comment: Commited in py3k (r80135), blocked in 3.1 (r80136). Python 3.1 has no _posixsubprocess module, it uses os.chdir() which accepts bytes, bytearray and str with surrogates. -- resolution: -> fixed status: open -> closed

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-15 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file16920/posixsubprocess_cwd.patch ___ Python tracker ___ ___ Python-bugs-lis

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-15 Thread STINNER Victor
STINNER Victor added the comment: New patch supporting bytearray type (remove the buggy assertion). -- Added file: http://bugs.python.org/file16939/posixsubprocess_cwd-2.patch ___ Python tracker ___

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-13 Thread STINNER Victor
STINNER Victor added the comment: See also #8391. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue8393] subprocess: support undecodable current working directory on POSIX OS

2010-04-13 Thread STINNER Victor
New submission from STINNER Victor : In py3k, subprocess uses _posixsubprocess.fork_exec() function. This function uses surrogateescape error handler for most arguments, but not for the current working directory (cwd). Attached patch uses PyUnicode_FSConverter() as done for other arguments. I