[issue31122] SSLContext.wrap_socket() throws OSError with errno == 0

Dima Tisnek report at bugs.python.org
Wed Mar 4 01:50:39 EST 2020


Dima Tisnek <dimaqq at gmail.com> added the comment:

I've traced it down to here: https://github.com/python/cpython/blob/be501ca2419a91546dea85ef4f36945545458589/Modules/_ssl.c#L791-L798

`err.c` (errno) == 0, no error, and `err.ssl` == 5, SSL_ERROR_SYSCALL, helpfully commented "look at error stack/return value/errno" in openssl/ssl.h 😅

I'm a bit suspicious about `s->errorhandler()` which is some old convention (git blame: 8 years ago), commented "checks errno, returns NULL, set a Python exception", but at this point, we know that errno is 0, so why call it?

I'm thinking to just change that to SSLEOFError, but I wonder if something else might break?

----------

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


More information about the Python-bugs-list mailing list