New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bytes for os.exec*() #48285
Comments
os.exec*() functions doesn't support bytes if the program name doesn't python -c "import os; os.execvp('pwd', 'pwd')"
Traceback (most recent call last):
...
File "/home/haypo/prog/py3k/Lib/os.py", line 328, in execvp
_execvpe(file, args)
File "/home/haypo/prog/py3k/Lib/os.py", line 364, in _execvpe
func(fullname, *argrest)
TypeError: execv() arg 2 must be a tuple or list Attached patch allows bytes in os.exec*(). It converts each directory |
This is incorrect. On Windows, if the path contains characters with no |
The fix can be changed to be specific to POSIX system: My example was incorrect. The good example is: |
Can you come up with a test case? Also, it would probably be good to document what parameters can have |
The patch is incomplete. It allows bytes for the arguments but not for |
Improved patch:
Document is not updated yet. |
Hmm, I think the supported types should be the same for all platforms, Perhaps, in addition to the proposed behaviour on Posix (convert |
I'm don't know Windows very well, but I read many times that Windows See also issue bpo-4036 (bytes for subprocess.Popen), especially Martin's |
Every function of the Windows API comes in pair: an Ansi function (which Don't perform conversion on Windows, just call the proper function. |
Any discussion in the tracker should be deferred until a PEP has been |
Fixed by r72313 (PEP-383). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: