mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #14837: SSL errors now have library
and reason
attributes describing precisely what happened and in which OpenSSL submodule.
The str() of a SSLError is also enhanced accordingly. NOTE: this commit creates a reference leak. The leak seems tied to the use of PyType_FromSpec() to create the SSLError type. The leak is on the type object when it is instantiated: >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 35 >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 36 >>> e = ssl.SSLError() >>> sys.getrefcount(ssl.SSLError) 37
This commit is contained in:
parent
31227ca514
commit
3b36fb1f53
4 changed files with 262 additions and 65 deletions
|
@ -59,6 +59,22 @@ Functions, Constants, and Exceptions
|
|||
.. versionchanged:: 3.3
|
||||
:exc:`SSLError` used to be a subtype of :exc:`socket.error`.
|
||||
|
||||
.. attribute:: library
|
||||
|
||||
A string mnemonic designating the OpenSSL submodule in which the error
|
||||
occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible
|
||||
values depends on the OpenSSL version.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
.. attribute:: reason
|
||||
|
||||
A string mnemonic designating the reason this error occurred, for
|
||||
example ``CERTIFICATE_VERIFY_FAILED``. The range of possible
|
||||
values depends on the OpenSSL version.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
.. exception:: SSLZeroReturnError
|
||||
|
||||
A subclass of :exc:`SSLError` raised when trying to read or write and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue