subprocess considered harmfull?

Steven Bethard steven.bethard at
Sun Sep 25 21:40:31 CEST 2005

Uri Nix wrote:
>  Using the following snippet:
>   p =
> subprocess.Popen(nmake,stderr=subprocess.PIPE,stdout=subprocess.PIPE, \
>                        universal_newlines=True, bufsize=1)
>   os.sys.stdout.writelines(p.stdout)
>   os.sys.stdout.writelines(p.stderr)
>  Works fine on the command line, but fails when called from within
> Visual Studio, with the following error:
>   File "C:\Python24\lib\", line 549, in __init__
>     (p2cread, p2cwrite,
>   File "C:\Python24\lib\", line 609, in _get_handles
>     p2cread = self._make_inheritable(p2cread)
>   File "C:\Python24\lib\", line 650, in _make_inheritable
> TypeError: an integer is required

This looks like these known bugs:

Try setting stderr to subprocess.PIPE.  I think that was what worked for 
me.  (You might also try setting shell=True.  That's what I currently 
have in my code that didn't work before.)


More information about the Python-list mailing list