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 gvanrossum, kawai, pitrou
Date 2009-01-19.13:28:33
SpamBayes Score 2.0981739e-10
Marked as misclassified No
Message-id <1232371714.26.0.962427128757.issue4996@psf.upfronthosting.co.za>
In-reply-to
Content
Indeed, read1() is not documented as a standard method of either IOBase,
RawIOBase or BufferedIOBase. I suggest that it becomes a standard method
of IOBase, with a default implementation simply calling read(n).

It also means unbuffered stdio as it was recently committed doesn't work
for stdin:

$ ./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'
>>> 

I had been misguided by the fact that the interpreter prompt did work,
but it doesn't seem to use sys.stdin...
History
Date User Action Args
2009-01-19 13:28:34pitrousetrecipients: + pitrou, gvanrossum, kawai
2009-01-19 13:28:34pitrousetmessageid: <1232371714.26.0.962427128757.issue4996@psf.upfronthosting.co.za>
2009-01-19 13:28:33pitroulinkissue4996 messages
2009-01-19 13:28:33pitroucreate