Martin v. Löwis mar...@v.loewis.de 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
Amaury Forgeot d'Arc amaur...@gmail.com 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 stdin, line 1, in module
File D:\afa\python\py3k-1\lib\subprocess.py, line 681, in __init__
STINNER Victor victor.stin...@haypocalc.com 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 rep...@bugs.python.org
STINNER Victor victor.stin...@haypocalc.com 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
Amaury Forgeot d'Arc amaur...@gmail.com 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.
--
STINNER Victor victor.stin...@haypocalc.com 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.
Amaury Forgeot d'Arc amaur...@gmail.com 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,
STINNER Victor victor.stin...@haypocalc.com 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
STINNER Victor victor.stin...@haypocalc.com 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 rep...@bugs.python.org
New submission from STINNER Victor victor.stin...@haypocalc.com:
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
STINNER Victor victor.stin...@haypocalc.com added the comment:
See also #8391.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8393
___
___
11 matches
Mail list logo