Message217742
yes, line_buffering=(bufsize == 1) is necessary to support the current
Python io implementation or if C implementation is fixed to avoid
buffer.flush() on every write with write_through=True -- otherwise
bufsize is not respected in text mode (it would always mean bufsize=0).
Note: the current patch for issue #21396 (making C and Python io do the
same thing) may break subprocess code with universal_newlines=True that
expects (incorrectly) bufsize=0 by default -- as test_universal_newlines
had (enabling universal_newlines shouldn't switch from bufsize=-1 to
bufsize=0). <-- XXX backward compatibility issue!
> Perhaps you can avoid the 10 s deadlock timeout and threading in your
> test by closing the underlying input pipe file descriptor (or raw file
> object), without flushing it.
It is a good idea. There could be portability issues with the test: it
relies on the fact that os.close doesn't flush already buffered data -- I
don't know whether os.close causes flush on Windows (it doesn't on POSIX
[1]: the data shall be discarded).
[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
I've uploaded a new patch with the updated tests. Please, review. |
|
| Date |
User |
Action |
Args |
| 2014-05-02 04:38:01 | akira | set | recipients:
+ akira, gregory.p.smith, jwilk, martin.panter, raylu |
| 2014-05-02 04:38:01 | akira | set | messageid: <1399005481.2.0.304834737037.issue21332@psf.upfronthosting.co.za> |
| 2014-05-02 04:38:01 | akira | link | issue21332 messages |
| 2014-05-02 04:38:00 | akira | create | |
|