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

Do not swallow exceptions in the _ssl module #80764

Closed
serhiy-storchaka opened this issue Apr 10, 2019 · 2 comments
Closed

Do not swallow exceptions in the _ssl module #80764

serhiy-storchaka opened this issue Apr 10, 2019 · 2 comments
Assignees
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 36583
Nosy @tiran, @alex, @serhiy-storchaka, @dstufft, @iritkatriel
PRs
  • bpo-36583: Do not swallow exceptions in the _ssl module. #12756
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2020-10-18.09:31:18.207>
    created_at = <Date 2019-04-10.07:22:39.797>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Do not swallow exceptions in the _ssl module'
    updated_at = <Date 2020-10-18.09:31:18.206>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-10-18.09:31:18.206>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2020-10-18.09:31:18.207>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2019-04-10.07:22:39.797>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36583
    keywords = ['patch']
    message_count = 2.0
    messages = ['339827', '378770']
    nosy_count = 6.0
    nosy_names = ['janssen', 'christian.heimes', 'alex', 'serhiy.storchaka', 'dstufft', 'iritkatriel']
    pr_nums = ['12756']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36583'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    Currently some exceptions can be swallowed in the _ssl module. The proposed PR fixes this. Some examples:

    • Use PyDict_GetItemWithError() instead of PyDict_GetItem(). The latter swallows any exceptions. Although it is very unlikely that an exception be raised here, it may be possible.

    • Do not overwrite arbitrary exceptions in PyUnicode_FSConverter(), PyUnicode_AsASCIIString() and PyObject_GetBuffer(). MemoryError most likely can be raised in the first two cases. Only expected exceptions (TypeError or UnicodeEncodeError) will now be replaced with a TypeError, and cadata type will be checked before trying to get a buffer or encode.

    @serhiy-storchaka serhiy-storchaka added 3.8 only security fixes stdlib Python modules in the Lib dir labels Apr 10, 2019
    @tiran tiran added the type-feature A feature request or enhancement label Apr 10, 2019
    @iritkatriel
    Copy link
    Member

    Can this be closed?

    @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.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants