[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
title: text files returned by subprocess.Popen with universal_newlines=True are 
not iterable - TextIOWrapper should fall back on read() if read1() doesn't 
exist

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

So, as the title indicates, I think we should make TextIOWrapper work with raw 
IO objects. The reason is so that write() can behave in a totally unbuffered 
way, which is necessary for Popen to behave appropriately.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hmm, one problem is that the C TextIOWrapper buffers writes. We would need an 
additional constructor parameter to prevent that :/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Another possibility is to provide read1() on RawIO, as a synonym of read().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Here is a first patch allowing TextIOWrapper to work with raw IO objects, and 
adding a write_through flag.

--
keywords: +patch
Added file: http://bugs.python.org/file22731/textio_rawio.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

write_through is not used in _pyio.py, is it expected?

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 write_through is not used in _pyio.py, is it expected?

Yup, because it is actually always write-through (writes are not
cached). The argument is only there so that the signature is the same as
the C version.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Looks good, then.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This additional patch improves universal_newlines support in subprocess (still 
broken with the select- and poll-based loops in communicate()).

--
Added file: http://bugs.python.org/file22732/spnewlines.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 9144014028f3 by Antoine Pitrou in branch '3.2':
Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
http://hg.python.org/cpython/rev/9144014028f3

New changeset c3b47cdea0d1 by Antoine Pitrou in branch 'default':
Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
http://hg.python.org/cpython/rev/c3b47cdea0d1

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5cc536fbd7c1 by Antoine Pitrou in branch '3.2':
Issue #12591: Improve support of universal newlines in the subprocess
http://hg.python.org/cpython/rev/5cc536fbd7c1

New changeset b616396fa170 by Antoine Pitrou in branch 'default':
Issue #12591: Improve support of universal newlines in the subprocess
http://hg.python.org/cpython/rev/b616396fa170

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, this should be fixed now. universal newlines support is still broken with 
communicate(), I've opened issue12623 for that.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com