homepage

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.

classification
Title: subprocess.Popen fails with closed stdout
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: astrand Nosy List: astrand, neuhauser
Priority: normal Keywords:

Created on 2005年04月10日 11:41 by neuhauser, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Messages (3)
msg24982 - (view) Author: neuhauser (neuhauser) Date: 2005年04月10日 11:41
I have a piece of code that gets run in a script that
has its stdout closed: 
 
 import sys
 sys.stdout = sys.stderr
 c = subprocess.Popen (...,
 stdin = subprocess.PIPE,
 stdout = subprocess.PIPE,
 stderr = subprocess.STDOUT) 
 
and this is what I get:
Sending SVNR/permissions
Transmitting file data .svn: Commit failed (details
follow): 
svn: 'pre-commit' hook failed with error output: 
 
Traceback (most recent call last):
 (...)
 File ".../__init__.py", line 40, in run
 stderr = subprocess.STDOUT) 
 
 File "/usr/local/lib/python2.4/subprocess.py", line
554, in __init__
 errread, errwrite)
 File "/usr/local/lib/python2.4/subprocess.py", line
986, in _execute_child
 raise child_exception
OSError: [Errno 2] No such file or directory 
 
This is the child_traceback:
 File "/usr/local/lib/python2.4/subprocess.py", line
955, in _execute_child
 File "/usr/local/lib/python2.4/os.py", line 341, in
execvp 
 File "/usr/local/lib/python2.4/os.py", line 379, in
_execvpe 
 func(fullname, *argrest)
OSError: [Errno 2] No such file or directory 
 
http://docs.python.org/lib/node230.html claims that
"PIPE indicates that a new pipe to the child should be
created" which doesn't seem to be the case.
Subversion code that runs the script can be seen at 
 
http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_repos/hooks.c
 
(run_hook_cmd()).
msg24983 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2005年04月14日 19:26
Logged In: YES 
user_id=344921
I can't se anything in your report that indicates that a
closed stdout is the problem. execvp() says "No such file or
directory", which means that the file you are trying to
execute doesn't exist. Do you have any reason to believe
that this error message is not true?
It would help if you could give me a working *Python*
example, indicating the problem. The source
http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_repos/hooks.c
is written in C, not Python...
msg24984 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2005年06月23日 16:05
Logged In: YES 
user_id=344921
No response in over 2 months. Closing. 
History
Date User Action Args
2022年04月11日 14:56:10adminsetgithub: 41837
2005年04月10日 11:41:18neuhausercreate

AltStyle によって変換されたページ (->オリジナル) /