> Except that Microsoft's C library also uses some of the non-WSA
> versions. For instance read() (or _read()) is documented to set
> errno to EBADF or EINVAL on error. So EBADF and EINVAL are just as
> "native" as WSAEBADF and WSAEINVAL.
read() is a posix function, so of course they set errno for it. You'll probably find that GetLastError() will some native error codes.
> It is also quite common for python's C code to do stuff like
> errno = EINVAL;
> PyErr_SetFromErrno(PyExc_OSError);
This doesn't change that, and as far as I know, this has worked and continues to work. "errno" is supported.
> errnomap in Objects/exceptions.c is used to convert some OSError
> exceptions to subclasses like PermissionError. It shouldn't be hard
> to use it to also convert WSAEINVAL to EINVAL etc.
Why would we get different errors codes for e.g. connection reset events because we build with a different compiler?
Python has always used the native error codes for socket io on windows, why change that? |