[New-bugs-announce] [issue42175] long lines from interactive stdin are truncated

Anthony Sottile report at bugs.python.org
Tue Oct 27 13:37:22 EDT 2020


New submission from Anthony Sottile <asottile at umich.edu>:

this was originally pointed out in a comment on my youtube video here: https://youtu.be/Xf_82stIbB8


here's a reproduction:

1. produce 5000 characters of output: python3 -c 'print("a"*5000)'
2. copy that to the clipboard
3. run this: python3 -c 'import sys; print(len(sys.stdin.read()))'
4. paste
5. press enter
6. ^D

I get the following:

$ python3 -c 'import sys; print(len(sys.stdin.read()))'
...
4096

but I expect the value to be 5001 (+1 for the \n)

----------
messages: 379783
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: long lines from interactive stdin are truncated
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list