Ross Lagerwall <rosslagerw...@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 <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