Custom Query (344 matches)
Results (82 - 84 of 344)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#299 | fixed | python: Special BEGINLIBPATH processing is broken | ||
Description |
At least with |
|||
#267 | fixed | python: Piping via subprocess.Popen is broken | ||
Description |
While using Consider this snippet: import os, subprocess os.putenv ('LANG', 'en_US') cmd1 = ['cat', 't.py'] cmd2 = ['grep', 'cmd'] proc1 = subprocess.Popen (cmd1, stdout = subprocess.PIPE) proc2 = subprocess.Popen (cmd2, stdin = proc1.stdout) rc = proc2.wait () print '*** proc2 rc', rc rc = proc1.wait () print '*** proc1 rc', rc On OS/2 (python 2.7.6-18.oc00) it gives the following output: grep: (standard input): Operation not supported on socket *** proc2 rc 2 *** proc1 rc 0 Expected result (tested on macOS): cmd1 = ['cat', 't.py'] cmd2 = ['grep', 'cmd'] proc1 = subprocess.Popen (cmd1, stdout = subprocess.PIPE) proc2 = subprocess.Popen (cmd2, stdin = proc1.stdout) *** proc2 rc 0 *** proc1 rc 0 I.e. the child process fails to read from its stdin (which is a pipe connected to the parent's stdout) on OS/2.
Note that if you replace 2 blocks cpio: error closing archive: Bad file number meaning that cpio worked per se (files unpacked correctly) but failed to close the input stream. Also note that both examples work smoothly as shell commands from under dash or ash. It looks like we're using pipes (or socket pairs?) incorrectly in Python. |
|||
#280 | fixed | python: Make subprocess.Popen thread-safe | ||
Description |
In #275 This is not thread safe as another parent thread might want to use stdin/out/err while they are redirected and the results may be quite unpredictable. One example is https://github.com/bitwiseworks/mozilla-os2/issues/247#issuecomment-346183854. This needs to be fixed. |