This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients benjamin.peterson, fabioz, pitrou, vstinner
Date 2009-01-19.16:27:01
SpamBayes Score 2.5518643e-11
Marked as misclassified No
Message-id <1232382447.96.0.342000450674.issue4705@psf.upfronthosting.co.za>
In-reply-to
Content
Reopening, since sys.stdin is actually broken in unbuffered mode:

$ ./python -u
Python 3.1a0 (py3k:68756, Jan 19 2009, 01:17:26) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdin.read(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/py3k/__svn__/Lib/io.py", line 1739, in read
    eof = not self._read_chunk()
  File "/home/antoine/py3k/__svn__/Lib/io.py", line 1565, in _read_chunk
    input_chunk = self.buffer.read1(self._CHUNK_SIZE)
AttributeError: 'FileIO' object has no attribute 'read1'
>>> 

What I propose is that stdin be always opened in buffered mode (even
with -u), since I don't see how the behaviour can differ for a read-only
non-seekable stream.
History
Date User Action Args
2009-01-19 16:27:28pitrousetrecipients: + pitrou, vstinner, fabioz, benjamin.peterson
2009-01-19 16:27:27pitrousetmessageid: <1232382447.96.0.342000450674.issue4705@psf.upfronthosting.co.za>
2009-01-19 16:27:02pitroulinkissue4705 messages
2009-01-19 16:27:01pitroucreate