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

Document C API functions which swallow exceptions #79642

Closed
serhiy-storchaka opened this issue Dec 11, 2018 · 5 comments
Closed

Document C API functions which swallow exceptions #79642

serhiy-storchaka opened this issue Dec 11, 2018 · 5 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

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']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes labels Dec 11, 2018
    @serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Dec 11, 2018
    @serhiy-storchaka
    Copy link
    Member Author

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

    @miss-islington
    Copy link
    Contributor

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

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @ned-deily
    Copy link
    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

    @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 3.8 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants