[issue11459] Python select.select does not correctly report read readyness

Ross Lagerwall report at bugs.python.org
Tue Mar 15 16:02:57 CET 2011


Ross Lagerwall <rosslagerwall at gmail.com> added the comment:

The Charles' patch fixes the problem but breaks [test_os test_poll test_popen test_select test_uuid] when running make test.

Those two lines were introduced by Guido in [1f7891d84d93] but that was back in 2007 when subprocess used os.fdopen and the new IO hadn't been invented (I think). They should probably be removed now.

I think it breaks those tests because despite the fact that the docs claim subprocess defaults to unbuffered, it has been set at bufsize=1 which actually causes line buffering mode. os.popen wraps the returned stream with a TextIOWrapper which doesn't work with an unbuffered stream.

The attached patch causes os.popen (and platform.popen) to default to line buffered mode and to throw an error if buffering=0 is passed (unbuffered).

I don't think this should be backported since there is some behavior change.

----------
stage:  -> patch review
Added file: http://bugs.python.org/file21212/11459.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11459>
_______________________________________


More information about the Python-bugs-list mailing list