This improves the type annotations for the ‘ssl’ module:
- Various APIs taking file names (e.g. keyfile=, certfile=, cafile=,
capath=, ...) were annotated as accepting only strings, while actually
they accept str, bytes, and os.PathLike (such as pathlib.Path).
CPython's _ssl.c module has always used PyUnicode_FSConverter to
handle (normalize) these. Change the annotations accordingly using the
internal _typeshed.StrOrBytesPath alias.
- Tighten the ‘purpose=’ argument in various functions to use the
already defined ‘Purpose’ enum instead of accepting ‘Any’.
* Extract _socket.pyi from socket.pyi.
* Extract _socket.socket from socket.socket.
* Fix socket.family annotation.
* Annotate SocketIO properly.
* SocketType is an alias of _socket.socket.
* Sort items in socket.pyi in the same order as in socket.py.
* Remove socket.EINTR.
* Use _typeshed.WriteableBuffer instead of custom alias.
* Add errorTab (Windows only).
* Add _socket.dup().
* Mark positional-only argments.
* Remove constructors from socket exceptions.
* socket.timeout is an alias for TimeoutError, starting with Python 3.10.
* Use PEP 604 in changed lines.
* Add alias for fileno arguments.
* getaddrinfo() port can be bytes.
* Explicitly override some SSLSocket methods.
* Allow ReadableBuffer in _CMSG arguments.
* run script and do some manual changes (Akuli)
* do the whole thing manually (srittau)
* merge changes (Akuli)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>