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 serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-11-22.07:40:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Usually the read() method of a file-like object takes one optional argument which limits the amount of data (the number of bytes or characters) returned if specified. also has such parameter. But this is the second parameter. The first parameter limits the number of bytes read for decoding. read(1) can return 70 characters, that will confuse most callers which expect either a single character or an empty string (at the end of stream).

Some times ago was recommended as a replacement for the builtin open() in programs that should work in 2.x and 3.x (this was before adding, and it is still used in many programs. But this peculiarity makes it bad replacement of builtin open().

I wanted to fix this issue long time ago, but forgot, and the question on Stack Overflow has reminded me about this.
Date User Action Args
2017-11-22 07:40:16serhiy.storchakasetrecipients: + serhiy.storchaka
2017-11-22 07:40:16serhiy.storchakasetmessageid: <>
2017-11-22 07:40:16serhiy.storchakalinkissue32110 messages
2017-11-22 07:40:16serhiy.storchakacreate