[New-bugs-announce] [issue36583] Do not swallow exceptions in the _ssl module

Serhiy Storchaka report at bugs.python.org
Wed Apr 10 03:22:39 EDT 2019


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
components: Library (Lib)
messages: 339827
nosy: alex, christian.heimes, dstufft, janssen, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Do not swallow exceptions in the _ssl module
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36583>
_______________________________________


More information about the New-bugs-announce mailing list