[issue39673] TimeoutError

Eric V. Smith report at bugs.python.org
Tue Feb 18 08:03:06 EST 2020


Eric V. Smith <eric at trueblade.com> added the comment:

> These are both timeout errors but only `ETIMEDOUT` is accounted for?

Yes, only ETIMEDOUT is accounted for in Objects/exceptions.c. There's precedent for mapping multiple errnos to the same exception:

    ADD_ERRNO(BlockingIOError, EAGAIN);
    ADD_ERRNO(BlockingIOError, EALREADY);
    ADD_ERRNO(BlockingIOError, EINPROGRESS);
    ADD_ERRNO(BlockingIOError, EWOULDBLOCK);

You should probably raise this on python-ideas. I don't know if ETIME has some other accepted meaning. It's not mapped to any other exception, so it could be easily added. The only thing it would affect are people who are catching OSError and TimeoutError and are expecting ETIME to give an OSError, which seems a pretty niche case. Or I guess people who only catch TimeoutError and want to not catch the case where errno==ETIME.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39673>
_______________________________________


More information about the Python-bugs-list mailing list