Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32110>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to