subprocess -- broken pipe error

Steve Holden steve at holdenweb.com
Tue Jul 3 00:06:41 CEST 2007


7stud wrote:
> On Jul 2, 1:58 pm, Bjoern Schliessmann <usenet-
> mail-0306.20.chr0n... at spamgourmet.com> wrote:
>> 7stud wrote:
>>> Thanks for the response.  So are you saying that the only way you
>>> can get data out of a pipe is when the subprocess has terminated?
>> No, not only because Pipes aren't related to processes in any
>> special way.
>>
>> He said that you can't write to a pipe whose reader has already
>> terminated.
>>
> 
> What he said was:
> 
>> ...once the subprocess terminates (which it must have done for
>> p.stdout.read() to return a result)
> 
> And based on the results of the examples I posted in my last post, it
> seems to confirm that no data travels through a pipe until a program
> on one side of the pipe has terminated.
> 
No, you plonker!

No data is produced *by .read()* until the writer has closed it.

I really don't remember anyone in recent history as eager to willfully 
misunderstand any attempted assistance. Please try to read what is 
written more carefully. It's most annoying when "the better the advice 
the worse it's wasted", as the Scots say.

Please forgive my brusqueness.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------




More information about the Python-list mailing list