Skip to content

Misleading stating, that SIGINT handler is installed by default #72981

Closed

Description

@JanVeleck
mannequin
BPO 28795
Nosy @JulienPalard, @miss-islington
PRs
  • bpo-28795: Signal documentation: Fix misleading statement. #13121
  • [3.7] bpo-28795: Signal documentation: Fix misleading statement. (GH-13121) #13158
  • Files
  • issue28795-tip.diff
  • issue28795-2.7.diff
  • 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 2019-05-07.15:29:33.044>
    created_at = <Date 2016-11-24.22:25:57.469>
    labels = ['type-bug', '3.7', 'docs']
    title = 'Misleading stating, that SIGINT handler is installed by default'
    updated_at = <Date 2019-05-07.15:55:42.758>
    user = 'https://bugs.python.org/JanVeleck'

    bugs.python.org fields:

    activity = <Date 2019-05-07.15:55:42.758>
    actor = 'miss-islington'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-05-07.15:29:33.044>
    closer = 'mdk'
    components = ['Documentation']
    creation = <Date 2016-11-24.22:25:57.469>
    creator = 'Jan Veleck\xc3\xbd'
    dependencies = []
    files = ['45695', '45696']
    hgrepos = []
    issue_num = 28795
    keywords = ['patch']
    message_count = 7.0
    messages = ['281664', '281671', '281728', '282047', '341749', '341751', '341759']
    nosy_count = 4.0
    nosy_names = ['docs@python', 'mdk', 'Jan Veleck\xc3\xbd', 'miss-islington']
    pr_nums = ['13121', '13158']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28795'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4', 'Python 3.5', 'Python 3.6', 'Python 3.7']

    Activity

    1. JanVeleck commented on Nov 24, 2016

      JanVeleckmannequin
      MannequinAuthor

      Hello,
      documentation (https://docs.python.org/2/library/signal.html) states, that Python by default installs SIGINT handler which cause KeyboardInterrupt. This is not true everytime according to implementation.
      "Python installs a small number of signal handlers by default: SIGPIPE ... and SIGINT is translated into a KeyboardInterrupt exception."
      It should also mention this "SIGINT is installed only, when default handler is set at startup.". Because user can run python script from non-interative shell as background task and SIGINT handler is not installed, regardless although user does not change Python default behaviour.

      Related SO:
      http://stackoverflow.com/questions/40775054/capturing-sigint-using-keyboardinterrupt-exception-works-in-terminal-not-in-scr/40785230?noredirect=1

    2. added
      docsDocumentation in the Doc dir
      type-bugAn unexpected behavior, bug, or error
      on Nov 24, 2016
    3. JulienPalard commented on Nov 25, 2016

      @JulienPalard
      Member

      Maybe something like:

      Python installs a small number of signal handlers by default: SIGPIPE is ignored (so write errors on pipes and sockets can be reported as ordinary Python exceptions) and SIGINT (if parent process has not changed it) is translated into a KeyboardInterrupt exception. All of these can be overridden.

    4. JanVeleck commented on Nov 25, 2016

      JanVeleckmannequin
      MannequinAuthor

      That's good.

    5. JulienPalard commented on Nov 29, 2016

      @JulienPalard
      Member

      Proposed as patches but english is not my native language so please review carefully.

    6. JulienPalard commented on May 7, 2019

      @JulienPalard
      Member

      New changeset e85ef7a by Julien Palard in branch 'master':
      bpo-28795: Signal documentation: Fix misleading statement. (GH-13121)
      e85ef7a

    7. JulienPalard commented on May 7, 2019

      @JulienPalard
      Member

      Thanks for reporting Jan! It's finally merged \o/

    8. miss-islington commented on May 7, 2019

      @miss-islington
      Contributor

      New changeset 721729f by Miss Islington (bot) in branch '3.7':
      bpo-28795: Signal documentation: Fix misleading statement. (GH-13121)
      721729f

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifedocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions