This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Amiy
Recipients Amiy
Date 2019-09-13.10:31:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org>
In-reply-to
Content
input function raises a SystemError in bash(similar shells)
when given inputs follow a certain pattern, doesn't happen in python interactive shell.

It causes crash in python scripts even if KeyboardInterrupt and EOFError are handeled.

No EOFError or KeyboardInterrupt error is raised in such cases.

Tested with python script: (file input-test.py)
and command:
python -c 'input()'
both yield same result.

Inputs are represented as: ^D :- CTRL+d, ^C :- CTRL+c 

eg:
input:
sometext^D^D^C

Traceback:
[182]$ python -c 'input()'
sometext^CKeyboardInterrupt

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: <built-in function input> returned a result with an error set

-----

inputs:
sometext^D^C^C [or even] sometext^Dsome-more^C^C

Traceback:
[191]$ python input-test.py
sometext^C^CKeyboardInterrupt

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "input-test.py", line 2, in <module>
    tmp = input()
SystemError: <built-in function input> returned a result with an error set

Python version: 3.7
Bash version: 5.0.11
History
Date User Action Args
2019-09-13 10:31:38Amiysetrecipients: + Amiy
2019-09-13 10:31:38Amiysetmessageid: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org>
2019-09-13 10:31:38Amiylinkissue38156 messages
2019-09-13 10:31:38Amiycreate