Message389266
It's still the case that we have to guess that a generic EINVAL (22) is actually EPIPE. Low-level wrapper functions in Python/fileutils.c, such as _Py_read() and _Py_write_impl(), should try to get a better error code by calling Python's custom winerror_to_errno() mapping function on the CRT's _doserrno value. For example:
_Py_read:
#ifdef MS_WINDOWS
n = read(fd, buf, (int)count);
if (n < 0 && errno == EINVAL) {
errno = winerror_to_errno(_doserrno);
}
_Py_write_impl:
#ifdef MS_WINDOWS
n = write(fd, buf, (int)count);
if (n < 0 && errno == EINVAL) {
errno = winerror_to_errno(_doserrno);
}
This maps ERROR_NO_DATA to EPIPE. |
|
Date |
User |
Action |
Args |
2021-03-22 00:14:18 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, jimbo1qaz_ |
2021-03-22 00:14:18 | eryksun | set | messageid: <1616372058.59.0.237822905314.issue35754@roundup.psfhosted.org> |
2021-03-22 00:14:18 | eryksun | link | issue35754 messages |
2021-03-22 00:14:18 | eryksun | create | |
|