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 lemburg, serhiy.storchaka
Date 2017-11-22.09:56:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511344617.83.0.213398074469.issue32110@psf.upfronthosting.co.za>
In-reply-to
Content
> That's not true. .read(1) will at most read 1 byte from the stream
> and decode it. There's no way it will return 70 characters.

See the added tests. They are failed without changing the read() method.

.read(1) currently returns all characters from the characters buffer. And this buffer can be not empty after .readline().

I understand the reason of having two limitation parameters in StreamReader.read(). But currently its behavior does not completely match the expected behavior of the read() method with one argument.

Actually size already has been used instead of chars if chars < 0 for reading in a loop. The code can be simplified.
History
Date User Action Args
2017-11-22 09:56:57serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg
2017-11-22 09:56:57serhiy.storchakasetmessageid: <1511344617.83.0.213398074469.issue32110@psf.upfronthosting.co.za>
2017-11-22 09:56:57serhiy.storchakalinkissue32110 messages
2017-11-22 09:56:57serhiy.storchakacreate