Skip to content

Document C API functions which swallow exceptions #79642

Description

@serhiy-storchaka
BPO 35461
Nosy @rhettinger, @ronaldoussoren, @vstinner, @ned-deily, @ericsnowcurrently, @serhiy-storchaka, @miss-islington
PRs
  • bpo-35461: Document C API functions which suppress exceptions. #11119
  • [3.7] bpo-35461: Document C API functions which suppress exceptions. (GH-11119) #11209
  • [3.6] bpo-35461: Document C API functions which suppress exceptions. (GH-11119) #11210
  • 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 2018-12-19.09:24:15.051>
    created_at = <Date 2018-12-11.13:27:28.106>
    labels = ['3.8', 'type-feature', '3.7', 'docs']
    title = 'Document C API functions which swallow exceptions'
    updated_at = <Date 2018-12-20.21:28:32.946>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-12-20.21:28:32.946>
    actor = 'ned.deily'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-12-19.09:24:15.051>
    closer = 'serhiy.storchaka'
    components = ['Documentation']
    creation = <Date 2018-12-11.13:27:28.106>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35461
    keywords = ['patch']
    message_count = 5.0
    messages = ['331620', '332053', '332077', '332114', '332262']
    nosy_count = 8.0
    nosy_names = ['rhettinger', 'ronaldoussoren', 'vstinner', 'ned.deily', 'docs@python', 'eric.snow', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['11119', '11209', '11210']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35461'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    Activity

    1. serhiy-storchaka commented on Dec 11, 2018

      @serhiy-storchaka
      MemberAuthor

      C API functions like PyDict_GetItem() and PyObject_HasAttr() suppresses all errors that may occur, including MemoryError and KeyboardInterrupt. They can return incorrect result when the memory is exhausted or the user presses Ctrl-C. The proposed PR documents such functions and suggests the C API which do not swallow unrelated exceptions.

      Previous attempt to document this (for PyDict_GetItem() only) was in bpo-20615.

    2. serhiy-storchaka commented on Dec 18, 2018

      @serhiy-storchaka
      MemberAuthor

      New changeset 3fcc1e0 by Serhiy Storchaka in branch 'master':
      bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
      3fcc1e0

    3. miss-islington commented on Dec 18, 2018

      @miss-islington
      Contributor

      New changeset f265afe by Miss Islington (bot) in branch '3.7':
      bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
      f265afe

    4. serhiy-storchaka commented on Dec 19, 2018

      @serhiy-storchaka
      MemberAuthor

      There are too much differences in the C API and the documentation between 3.x and 2.7, so backporting to 2.7 is not practical.

    5. ned-deily commented on Dec 20, 2018

      @ned-deily
      Member

      New changeset ff740db by Ned Deily (Miss Islington (bot)) in branch '3.6':
      bpo-35461: Document C API functions which suppress exceptions. (GH-11119) (GH-11210)
      ff740db

    6. 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 life3.8 (EOL)end of lifedocsDocumentation in the Doc dirtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions