Message352282
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 |
|
Date |
User |
Action |
Args |
2019-09-13 10:31:38 | Amiy | set | recipients:
+ Amiy |
2019-09-13 10:31:38 | Amiy | set | messageid: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> |
2019-09-13 10:31:38 | Amiy | link | issue38156 messages |
2019-09-13 10:31:38 | Amiy | create | |
|