jazzband / imaplib2

Fork of Piers Lauder's imaplib2 library for Python.
https://imaplib2.readthedocs.io/
MIT License
33 stars 29 forks source link

The socket package has no sslerror module #36

Open Pantoofle opened 2 years ago

Pantoofle commented 2 years ago

https://github.com/jazzband/imaplib2/blob/a7eb3b677b40f314cd49dba49aa237d7dc8ffbba/imaplib2/imaplib2.py#L510

The socket package has no sslerror module (see the doc here) The ssl package has something close. Maybe there were a confusion between the two packages ?

So if an invalid ssl_version is given, the program crashes before raising the error.

piyueh commented 2 years ago

Yah, that's from Python 2's socket module and does not exist anymore in Python 3: https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Lib/socket.py#L67

PR's welcome!