New submission from Kelly Brazil :
When iterating on sys.stdin lines, '\r\n' and '\n' are handled correctly, but
'\r' is not handled, though it is documented that it should be supported.
Example code:
import sys
for line in sys.stdin:
print(repr(line))
Resu
Change by Kelly Brazil :
--
components: +Library (Lib)
___
Python tracker
<https://bugs.python.org/issue45617>
___
___
Python-bugs-list mailing list
Unsubscribe:
Kelly Brazil added the comment:
'\r' support is implicitly documented under the sys.stdin section[0]:
"These streams are regular text files like those returned by the open()
function. Their parameters are chosen as follows..."
By following the link to the open()[1] docs
Kelly Brazil added the comment:
Also, I believe this docstring is being inherited, but this is also where it
seems that '\r' is documented to work with sys.stdin:
>>> print(sys.stdin.__doc__)
Character and line based layer over a BufferedIOBase object, buffer.
encoding gi
Kelly Brazil added the comment:
Are there other scenarios where splitlines behavior deviates from the default
of newline=None (Universal Newlines)? It seems sys.stdin (on non-Windows OS) is
the outlier.
All of these use Universal Newlines:
- sys.stdin (on Windows)
- open(0,