[New-bugs-announce] [issue45511] input() method limited to 4095 characters on *NIX

Romuald Brunet report at bugs.python.org
Mon Oct 18 08:32:04 EDT 2021


New submission from Romuald Brunet <romuald.brunet at gmail.com>:

When run in non-interactive mode and with a TTY stdin, the input() method will not read more than 4095 characters

Simple example:

>>> foo = input()  # paste a 5000 character pasteboard (one line)
>>> print(len(foo))
4095

Note that this will **not** happen when using an interactive shell (using python -i on the same script will not have the 4095 limit)

I've traced the issue (I think) to the fgets function called from my_fgets in myreadline.c, but I have no clue as to how one might fix this.

----------
components: Interpreter Core
messages: 404179
nosy: Romuald
priority: normal
severity: normal
status: open
title: input() method limited to 4095 characters on *NIX
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list