Message159373
> the errno codes (EAGAIN etc) are provided only as a compatibility for
> posix apps that test "errno". On windows, we use the WSA return values
> from the api functions and WsaGetLastError().
> ...
> So, the proposed patch is not a change, it is merely reinforcing the
> previous practice of prefering the native error codes over the 'errno'
> emulation.
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.
It is also quite common for python's C code to do stuff like
errno = EINVAL;
PyErr_SetFromErrno(PyExc_OSError);
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. |
|
Date |
User |
Action |
Args |
2012-04-26 15:05:00 | sbt | set | recipients:
+ sbt, loewis, mhammond, jackjansen, mark.dickinson, kristjan.jonsson, vstinner, sable, tim.golden, tarek, eric.araujo, brian.curtin, santoso.wijaya, alexis |
2012-04-26 15:05:00 | sbt | set | messageid: <1335452700.28.0.945936919182.issue13210@psf.upfronthosting.co.za> |
2012-04-26 15:04:59 | sbt | link | issue13210 messages |
2012-04-26 15:04:59 | sbt | create | |
|