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

sys.stdin.readline and KeyboardInterrupt on windows #58495

Closed
miwa mannequin opened this issue Mar 13, 2012 · 3 comments
Closed

sys.stdin.readline and KeyboardInterrupt on windows #58495

miwa mannequin opened this issue Mar 13, 2012 · 3 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@miwa
Copy link
Mannequin

miwa mannequin commented Mar 13, 2012

BPO 14287
Nosy @vadmium
Superseder
  • bpo-18597: On Windows sys.stdin.readline() doesn't handle Ctrl-C properly
  • Files
  • z.py
  • 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 2015-06-06.05:21:35.649>
    created_at = <Date 2012-03-13.14:07:04.820>
    labels = ['type-bug', 'OS-windows']
    title = 'sys.stdin.readline and KeyboardInterrupt on windows'
    updated_at = <Date 2015-06-06.05:21:35.647>
    user = 'https://bugs.python.org/miwa'

    bugs.python.org fields:

    activity = <Date 2015-06-06.05:21:35.647>
    actor = 'martin.panter'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-06-06.05:21:35.649>
    closer = 'martin.panter'
    components = ['Windows']
    creation = <Date 2012-03-13.14:07:04.820>
    creator = 'miwa'
    dependencies = []
    files = ['24821']
    hgrepos = []
    issue_num = 14287
    keywords = []
    message_count = 3.0
    messages = ['155612', '222184', '244893']
    nosy_count = 3.0
    nosy_names = ['miwa', 'BreamoreBoy', 'martin.panter']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '18597'
    type = 'behavior'
    url = 'https://bugs.python.org/issue14287'
    versions = ['Python 2.7', 'Python 3.2']

    @miwa
    Copy link
    Mannequin Author

    miwa mannequin commented Mar 13, 2012

    I run z.py and press Ctrl-C.

    ''
    Traceback (most recent call last):
      File "z.py", line 7, in <module>
        print(repr(x))
    KeyboardInterrupt

    I think '' should not be printed. This sometimes occurs on Python 3.2.2 and 2.7.2 AMD64 on Windows7, but doesn't occur on ubuntu.

    @miwa miwa mannequin added OS-windows type-bug An unexpected behavior, bug, or error labels Mar 13, 2012
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 3, 2014

    FWIW the same occurs on Windows 7 with 3.5.0 but given there are known differences between Windows and *nix is this really an issue?

    @vadmium
    Copy link
    Member

    vadmium commented Jun 6, 2015

    If the interrupt truly occurred after readline() succeeded, then x should contain actual input from the user, not the empty string. So I think this is a valid bug.

    However it looks like this is the same as bpo-18597, which has more discussion.

    @vadmium vadmium closed this as completed Jun 6, 2015
    @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
    OS-windows type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant