Charles-Francois Natali <neolo...@free.fr> added the comment:

Could you try with the attached patch ?
The problem is that subprocess silently replaces bufsize=0, so child.stdout is 
actually buffered, and when you read just one byte, everything that's available 
for reading is read into the python's object buffer. Then, select/poll doesn't 
see the pipe as ready for reading since everything as already been read.
Mixing buffered I/O and select leads to trouble, you're right to pass 
bufsize=0, but I don't know why subprocess goes out of its way and buffers it 
anyway:
        if bufsize == 0:
            bufsize = 1  # Nearly unbuffered (XXX for now)

----------
keywords: +patch
nosy: +neologix
Added file: http://bugs.python.org/file21068/subprocess_buffer.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11459>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to