This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年06月03日 09:47 by socketpair, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| z.patch | socketpair, 2011年06月03日 10:05 | patch for the problem | ||
| Messages (5) | |||
|---|---|---|---|
| msg137510 - (view) | Author: Марк Коренберг (socketpair) * | Date: 2011年06月03日 09:47 | |
How to test: ---------------- #! /usr/bin/python import subprocess, sys # will print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir']) # will NOT print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir'], stdout=sys.stderr) ---------------- According to strace, in child process: ----------------- dup2(2, 1) // that's what I expect, okay close(2) // that's I was not expect, so bug here execve(...) ----------------- Bug is in subprocess.py: (search for "dup2" in file) I do not known how to fix correctly. Logick in this module is brain damaged in some places. ----------------------------- # Dup fds for child if p2cread is not None: os.dup2(p2cread, 0) if c2pwrite is not None: os.dup2(c2pwrite, 1) if errwrite is not None: os.dup2(errwrite, 2) # Close pipe fds. Make sure we don't close the same # fd more than once, or standard fds. if p2cread is not None and p2cread not in (0,): os.close(p2cread) if c2pwrite is not None and c2pwrite not in (p2cread, 1): os.close(c2pwrite) if errwrite is not None and errwrite not in (p2cread, c2pwrite, 2): os.close(errwrite) ------------------------- |
|||
| msg137512 - (view) | Author: Марк Коренберг (socketpair) * | Date: 2011年06月03日 10:05 | |
patch (was not tested) attached |
|||
| msg137517 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2011年06月03日 11:55 | |
It's a duplicate of issue #10806, fixed in 2.7, 3.1 and 3.2. Closing. |
|||
| msg137518 - (view) | Author: Марк Коренберг (socketpair) * | Date: 2011年06月03日 13:23 | |
Why not to backport to python 2.6 ? this is the bug, not a feature. |
|||
| msg137519 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年06月03日 14:27 | |
Because 2.6 is in security-fix-only mode. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:18 | admin | set | github: 56460 |
| 2011年06月03日 14:27:30 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg137519 |
| 2011年06月03日 13:23:52 | socketpair | set | messages: + msg137518 |
| 2011年06月03日 11:55:07 | neologix | set | status: open -> closed superseder: Subprocess error if fds 0,1,2 are closed nosy: + neologix messages: + msg137517 resolution: duplicate stage: resolved |
| 2011年06月03日 10:42:14 | vstinner | set | nosy:
+ vstinner |
| 2011年06月03日 10:26:57 | Evgeny.Tarasov | set | nosy:
+ Evgeny.Tarasov |
| 2011年06月03日 10:05:38 | socketpair | set | files:
+ z.patch keywords: + patch messages: + msg137512 |
| 2011年06月03日 09:48:18 | alexey-smirnov | set | nosy:
+ alexey-smirnov |
| 2011年06月03日 09:47:08 | socketpair | create | |