Opened 11 years ago
Closed 10 years ago
#141 closed defect (fixed)
python: subprocess.Popen (shell=True) fails
| Reported by: | dmik | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | python | Version: | |
| Severity: | medium | Keywords: | |
| Cc: |
Description
I've just discovered that subprocess.Popen (shell=True) fails with
File "C:/USR/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "C:/USR/lib/python2.7/subprocess.py", line 1328, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
This relates to the current Python version 2.7.6-11.
Change History (4)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
LIbc has nothing to do with that. The supbrocess module uses fork() and just passes /bin/sh to it (which it has nothing to do with because it's an "absolute" path). So we should fix Python by replacing /bin/sh with /@unixroot/usr/bin/sh or better even checking the EMXSHELL first and then falling back to a hard-coded value.
comment:3 by , 10 years ago
JFYI, more details about the issue are here: https://github.com/bitwiseworks/mozilla-os2/issues/100#issuecomment-95712971
comment:4 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This is fixed in r603. I decided to use SHELL that was configured during python build.

It turns out that python uses a hard-coded shell path
/bin/shwhen going POSIX way (what a nice decision). However, after recent fixes tospawn/execin libc 0.6.6 this should work pretty well in our Unix environment. I need to find why it fails.