popen problems

Discussion in 'Python' started by David McNab, Aug 21, 2003.

  1. David McNab

    David McNab Guest

    Hi,

    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?

    Cheers
    David
    David McNab, Aug 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Byrom, R (Rob)

    problems with popen (linux7.3 python2.2.2)

    Byrom, R (Rob), Nov 26, 2003, in forum: Python
    Replies:
    0
    Views:
    277
    Byrom, R (Rob)
    Nov 26, 2003
  2. Replies:
    1
    Views:
    265
    Will McGugan
    Aug 17, 2004
  3. =?iso-8859-1?B?aWFuYXLp?=

    real time updating of popen, bufsize=0 problems

    =?iso-8859-1?B?aWFuYXLp?=, Apr 6, 2007, in forum: Python
    Replies:
    4
    Views:
    564
    =?iso-8859-1?B?aWFuYXLp?=
    Apr 6, 2007
  4. Jesse

    Popen and wget, problems

    Jesse, May 12, 2007, in forum: Python
    Replies:
    3
    Views:
    522
  5. File.popen/IO.popen

    , May 20, 2006, in forum: Ruby
    Replies:
    1
    Views:
    213
    Robert Klemme
    May 20, 2006
Loading...

Share This Page