[Tutor] "standard output: Broken pipe"

James jtp at nc.rr.com
Sat Oct 20 04:14:16 CEST 2007


Hi,

I have a snippet of code in a Python script I'm whipping up that's  
causing a not-so-pretty output.  Here's the code:

subprocess.call( "yes '' | make oldconfig" , shell=True )

When I run this code, Python loyally executes the command, and then I  
see the following error on my console:

-----

yes: standard output: Broken pipe
yes: write error

-----

I did some Googling and I believe found the reason for this error  
("yes" executes forever, and complains when Python kills the process  
off).  However, I'd like to figure out a way to get rid of the error  
(or hide it) so that it's not visible to the person running the  
script (it's not the prettiest thing to see scroll by your screen :)).

Thoughts / ideas?

Thanks!
.james


More information about the Tutor mailing list