[issue41450] OSError is not documented in ssl library, but still can be thrown

Senthil Kumaran report at bugs.python.org
Sun Dec 27 15:04:17 EST 2020


Senthil Kumaran <senthil at uthcode.com> added the comment:

This is resolved by Issue 31122 and code now raises SSLEOFError instead of OSError.

The reason for OSError in the first place was PySSL_SetError function had the following call s->errorhandler();

https://github.com/python/cpython/blob/3.7/Modules/_ssl.c#L782

Where the errorhandler of socketmodule.c was called, and error message that raised was OSError (https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L607)

---

In issue31122, Dima.Tisnek contributed a patch to remove the s-errorhandler() and replace it with  SSLEOFError https://github.com/python/cpython/commit/495bd035662fda29639f9d52bb6baebea31d72fa 

Since the patch was ported to 3.8 and 3.9, OSError is no longer raised by the ssl module for the do_handshake call or wherever PySSL_SetError is utilized.

Closing this bug report as resolved.

----------
assignee: docs at python -> orsenthil
nosy: +Dima.Tisnek, orsenthil
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list