Feature Requests item #1615376, was opened at 2006-12-14 01:21
Message generated for change (Comment added) made by astrand
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1615376&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: Python Library
>Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mark Diekhans (diekhans)
Assigned to: Peter Åstrand (astrand)
Summary: subprocess doesn\'t handle SIGPIPE

Initial Comment:
subprocess keeps other side of child pipe open, making
use of SIGPIPE to terminate writers in a pipeline
not possible.

This is probably a matter of documentation or
providing a method to link up processes, as 
the parent end of the pipe must remain open
until it is connected to the next process in
the pipeline.

An option to enable sigpipe in child would be
nice.

Simple example attached.

----------------------------------------------------------------------

>Comment By: Peter Åstrand (astrand)
Date: 2007-01-07 15:01

Message:
Logged In: YES 
user_id=344921
Originator: NO

One easy solution is to simply close the pipe in the parent after starting
both processes, before calling p1.wait():

p1.stdout.close()

It's not "perfect", though, p1 will execute a while before recieving
SIGPIPE. For a perfect solution, it would be necessary to close the pipe
end in the parent after the fork but before the exec in the child. This
would require some kind of synchronization. 

Moving to feature request. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1615376&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to