Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input fucntion raises SystemError after specific input. #82337

Closed
Amiy mannequin opened this issue Sep 13, 2019 · 7 comments
Closed

input fucntion raises SystemError after specific input. #82337

Amiy mannequin opened this issue Sep 13, 2019 · 7 comments
Labels
3.7 (EOL) end of life topic-IO type-bug An unexpected behavior, bug, or error

Comments

@Amiy
Copy link
Mannequin

Amiy mannequin commented Sep 13, 2019

BPO 38156
Nosy @vstinner, @benjaminp, @miss-islington
PRs
  • closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. #21569
  • [3.9] closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569) #21670
  • [3.8] closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569) #21671
  • bpo-38156: Fix compiler warning in PyOS_StdioReadline() #21721
  • [3.9] bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) #21723
  • [3.8] bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) #21725
  • Files
  • input-test.py: Input function test file.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-07-29.00:57:19.070>
    created_at = <Date 2019-09-13.10:31:38.783>
    labels = ['type-bug', '3.7', 'expert-IO']
    title = 'input fucntion raises SystemError after specific input.'
    updated_at = <Date 2020-08-04.00:59:05.561>
    user = 'https://bugs.python.org/Amiy'

    bugs.python.org fields:

    activity = <Date 2020-08-04.00:59:05.561>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-07-29.00:57:19.070>
    closer = 'benjamin.peterson'
    components = ['IO']
    creation = <Date 2019-09-13.10:31:38.783>
    creator = 'Amiy'
    dependencies = []
    files = ['48606']
    hgrepos = []
    issue_num = 38156
    keywords = ['patch']
    message_count = 7.0
    messages = ['352282', '374552', '374553', '374554', '374777', '374779', '374781']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'benjamin.peterson', 'miss-islington', 'Amiy']
    pr_nums = ['21569', '21670', '21671', '21721', '21723', '21725']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38156'
    versions = ['Python 3.7']

    @Amiy
    Copy link
    Mannequin Author

    Amiy mannequin commented Sep 13, 2019

    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

    @Amiy Amiy mannequin added type-crash A hard crash of the interpreter, possibly with a core dump 3.7 (EOL) end of life topic-IO type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 13, 2019
    @benjaminp
    Copy link
    Contributor

    New changeset a74eea2 by Benjamin Peterson in branch 'master':
    closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
    a74eea2

    @miss-islington
    Copy link
    Contributor

    New changeset 2221610 by Miss Islington (bot) in branch '3.9':
    closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
    2221610

    @miss-islington
    Copy link
    Contributor

    New changeset 7cfede6 by Miss Islington (bot) in branch '3.8':
    closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
    7cfede6

    @vstinner
    Copy link
    Member

    vstinner commented Aug 4, 2020

    New changeset bde48fd by Victor Stinner in branch 'master':
    bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
    bde48fd

    @miss-islington
    Copy link
    Contributor

    New changeset b6724be by Miss Islington (bot) in branch '3.9':
    bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
    b6724be

    @miss-islington
    Copy link
    Contributor

    New changeset 46e448a by Miss Islington (bot) in branch '3.8':
    bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
    46e448a

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IO type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants