Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > popen problems

Thread Tools

popen problems

David McNab
Posts: n/a

When using os.popen, or popen2.Popen3 objects, I see a situation when
the child process sometimes doesn't get terminated, even when the child
program has exited.

It's like Python (2.2.3) intermittently leaves the process dangling.
Sometimes 'killall python' doesn't clean up these dead tasks.

The only solution I've found has been to write a temporary input file,
call os.system("myprog < /tmp/infile > /tmp/outfile"), read the outfile,
then delete the temporary in/out files.

The child program in my case is filter programs in SpamBayes, which I've
always observed as terminating properly.

Any ideas?


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
Popen and wget, problems Jesse Python 3 05-13-2007 10:01 AM
real time updating of popen, bufsize=0 problems =?iso-8859-1?B?aWFuYXLp?= Python 4 04-06-2007 08:07 PM
File.popen/IO.popen Ruby 1 05-20-2006 08:20 AM
os popen problems in w98 Python 1 08-17-2004 01:08 PM
problems with popen (linux7.3 python2.2.2) Byrom, R (Rob) Python 0 11-26-2003 01:15 PM