Guido van Rossum added the comment:

> I believe so, too. The subprocess docs aren't warning about the problem.
> I've seen a fair share of programmers who fall for the trap - including
> me a few weeks ago.

Yes, the docs should definitely address this.

> Consider yet another example
>
> >>> p = Popen(someprogram, stdin=PIPE, stdout=PIPE)
> >>> p.stdin.write(10MB of data)
>
> someprogram processes the incoming data in small blocks. Let's say 1KB
> and 1MB stdin and stdout buffer. It reads 1KB from stdin and writes 1KB
> to stdout until the stdout buffer is full. The program stops and waits
> for for Python to free the stdout buffer. However the python code is
> still writing data to the limited stdin buffer.

Hm. I thought this would be handled using threads or select but it
doesn't seem to be quite the case. communicate() does the right thing
but if you use p.stdin.write() directly you may indeed hang.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1606>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to