Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > sys.stdout / sys.stderr, subprocess, redirection

Thread Tools

sys.stdout / sys.stderr, subprocess, redirection

Roman Neuhauser
Posts: n/a

I have a piece of code that gets run in a script that has its stdout

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 ".../", line 40, in run
stderr = subprocess.STDOUT)
File "/usr/local/lib/python2.4/", line 554, in __init__
errread, errwrite)
File "/usr/local/lib/python2.4/", 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/", line 955, in _execute_child
File "/usr/local/lib/python2.4/", line 341, in execvp
File "/usr/local/lib/python2.4/", line 379, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory

Is this a problem in subprocess (I'm using the FreeBSD port of Python-2.4
and subprocess that comes with that release) or is this expected? If my
expectations are broken (likely), what should the standard descriptor
massaging look like?

Subversion code that runs the script can be seen at

How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection Limit John Firefox 4 07-28-2005 10:47 AM
webcrawle with LWP: how to make redirection work? S Perl 1 01-14-2004 06:51 AM
input redirection MadHatter Perl 6 10-16-2003 04:05 PM
Re: Cisco PIX 6.31 Port Redirection - Not Working Memnoch Cisco 0 07-17-2003 05:22 PM
wccp 3550emi and Cacheflow 800 - transparent caching redirection Cisco 0 07-17-2003 02:48 AM