[New-bugs-announce] [issue43336] document whether io.TextIOBase.readline(size>0) will always read the full newline

Christoph Anton Mitterer report at bugs.python.org
Fri Feb 26 21:15:37 EST 2021


New submission from Christoph Anton Mitterer <calestyo at scientia.org>:

Hey.

It would be nice if the following behaviour could be definitely clarified:

When reading from a text stream with readline(size) with a n > 0size it says: "If size is specified, at most size characters will be read."

Also, depending on the settings of newlines of the stream, \r\n would be converted to \n.


It's not definitely clear whether a string like
"abc\r\n"
read with a size of = 4 will return "abc\n" (which it seems to do, in other words, it reads actually 5 characters, but sill returns only 4), or whether it returns "abc\r".


Cheers,
Chris.

----------
assignee: docs at python
components: Documentation
messages: 387758
nosy: calestyo, docs at python
priority: normal
severity: normal
status: open
title: document whether io.TextIOBase.readline(size>0) will always read the full newline

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43336>
_______________________________________


More information about the New-bugs-announce mailing list