[issue4192] Subprocess error with I/O redirection to Pipes

Pascal Chambon report at bugs.python.org
Fri Oct 24 17:23:20 CEST 2008


New submission from Pascal Chambon <chambon.pascal at gmail.com>:

I've created on my desktop a file flooder.py containing just the following:
##################
import sys, os

progress=open(r"C:\Users\v-pascha\Desktop\STDERR.txt","w")

for i in range(101):
   print str(i)*20
   progress.write( str(i)+"\n" )
   
progress.close()
##################


and a file receiver.py containing just :


################
import sys, os, subprocess

#os.system("pause")
subprocess.Popen(r"python
C:\Users\v-pascha\Desktop\flooder.py",stdin=subprocess.PIPE,stdout=subprocess.PIPE)
#,stdin=subprocess.PIPE,stdout=subprocess.PIPE
#os.system("pause")

#####################

And when I launch receiver.py, I get a crash with that (not explicit)
message :
"close failed in file object destructor:
Error in sys.excepthook:

Original exception was:"

The crash doesn't happen if I don't redirect the stdout and stdin of the
child process. So it seems something weird happens when subprocess tries
to redirect the child's I/O to the PIPEs...

----------
components: Library (Lib), Windows
messages: 75169
nosy: pakal
severity: normal
status: open
title: Subprocess error with I/O redirection to Pipes
type: crash
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4192>
_______________________________________


More information about the Python-bugs-list mailing list