Map errno==ETIME to TimeoutError

Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT. http://man7.org/linux/man-pages/man3/errno.3.html says: *ETIME *Timer expired (POSIX.1 (XSI STREAMS option)). (POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".) *ETIMEDOUT *Connection timed out (POSIX.1-2001). It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have. And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code. Eric

Sounds like a natural fit, I'd just do it for 3.10. On Sun, May 24, 2020, 9:45 AM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/

What's the class hierachy here? I for one have some code (not specificly timeouts) of the form: try: os.something(...) except OSError as e: if e.errno == errno.EPERM: suitable action else: raise in various permutations. I have the vague feeling that one of these broke for me recently because a call was not raisingeturning an OSError but one of the fine grained os-flavoured exceptions, like FileNotFoundError or the like. It may have involved something "high level" like open() instead of a direct os.something() call. Anyway, I'd like to know how this might affect try/except setups, particularly ones like the above which expect to catch a class of error and differentiate amongst them. I am not against the issue suggest though. Cheers, Cameron Simpson <cs@cskk.id.au> On 24May2020 14:59, Gregory P. Smith <greg@krypto.org> wrote:
Sounds like a natural fit, I'd just do it for 3.10.
On Sun, May 24, 2020, 9:45 AM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric

On 5/24/2020 9:31 PM, Cameron Simpson wrote:
What's the class hierachy here?
TimeoutError is derived from OSError. So if you're catching OSError and looking for errno == ETIME, you're good. If you're catching both OSError and TimoutError, an ETIME which used to be an OSError would now be a TimeoutError. Eric
I for one have some code (not specificly timeouts) of the form:
try: os.something(...) except OSError as e: if e.errno == errno.EPERM: suitable action else: raise
in various permutations. I have the vague feeling that one of these broke for me recently because a call was not raisingeturning an OSError but one of the fine grained os-flavoured exceptions, like FileNotFoundError or the like. It may have involved something "high level" like open() instead of a direct os.something() call.
Anyway, I'd like to know how this might affect try/except setups, particularly ones like the above which expect to catch a class of error and differentiate amongst them.
I am not against the issue suggest though.
Cheers, Cameron Simpson <cs@cskk.id.au>
On 24May2020 14:59, Gregory P. Smith <greg@krypto.org> wrote:
Sounds like a natural fit, I'd just do it for 3.10.
On Sun, May 24, 2020, 9:45 AM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric

24.05.20 17:48, Eric V. Smith пише:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
Why it was not mapped at first place? Was there any discussion?

On Mon, May 25, 2020 at 1:25 AM Serhiy Storchaka <storchaka@gmail.com> wrote:
24.05.20 17:48, Eric V. Smith пише:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
Why it was not mapped at first place? Was there any discussion?
AFAICT from a few minutes of searching, ETIME is almost never used, which probably explains it. It doesn't show up in glibc at all, and only a few times in the Linux kernel sources, most notably in the graphics subsystem -- and apparently this causes some annoyance for the *BSDs, which share a bunch of that code and don't have ETIME, so they #define ETIME ETIMEDOUT to get the code to build. I'm not sure there's any point in making the change – the BPO doesn't even have an example of it, just someone who was poking around in obscure corners of errno and noticed it – but it seems harmless. It sounds like literally no-one knows what the difference between these is supposed to be. -n -- Nathaniel J. Smith -- https://vorpus.org

On 5/25/2020 4:25 AM, Serhiy Storchaka wrote:
24.05.20 17:48, Eric V. Smith пише:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
Why it was not mapped at first place? Was there any discussion?
Good question. Perhaps Antoine can answer. I don't see any mention of ETIME in PEP 3151. I'm assuming it was just an oversight. I couldn't find any reference to ETIME on python-ideas or python-dev (other than this discussion), either. Eric

On Mon, 25 May 2020 04:38:17 -0400 "Eric V. Smith" <eric@trueblade.com> wrote:
On 5/25/2020 4:25 AM, Serhiy Storchaka wrote:
24.05.20 17:48, Eric V. Smith пише:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
Why it was not mapped at first place? Was there any discussion?
Good question. Perhaps Antoine can answer.
I don't see any mention of ETIME in PEP 3151. I'm assuming it was just an oversight. I couldn't find any reference to ETIME on python-ideas or python-dev (other than this discussion), either.
As Nathaniel said, it's simply because it didn't show up in any common system calls. It's probably harmless to add it, but probably also mostly pointless :-) Regards Antoine.

I'm -1 because the concept of "timeout" is generic enough to be often implemented as a custom exception, which poses questions re. backward/forward compatibilty. E.g. in psutil I have "TimeoutExpired", also providing a "seconds" attribute. Also I've probably never seen ETIME / ETIMEDOUT happening, whereas AFAIU the point PEP 3151 was to create mappings for the most common errnos. On Sun, May 24, 2020 at 6:48 PM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/
-- Giampaolo - http://grodola.blogspot.com

Thanks, Giampaolo. Could you leave a comment on the issue? Erci On 5/25/2020 10:32 AM, Giampaolo Rodola' wrote:
I'm -1 because the concept of "timeout" is generic enough to be often implemented as a custom exception, which poses questions re. backward/forward compatibilty. E.g. in psutil I have "TimeoutExpired", also providing a "seconds" attribute. Also I've probably never seen ETIME / ETIMEDOUT happening, whereas AFAIU the point PEP 3151 was to create mappings for the most common errnos.
On Sun, May 24, 2020 at 6:48 PM Eric V. Smith <eric@trueblade.com <mailto:eric@trueblade.com>> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAMioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric
_______________________________________________ Python-Dev mailing list -- python-dev@python.org <mailto:python-dev@python.org> To unsubscribe send an email to python-dev-leave@python.org <mailto:python-dev-leave@python.org> https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/
-- Giampaolo - http://grodola.blogspot.com

Sure. Done. On Mon, 25 May 2020 at 21:05, Eric V. Smith <eric@trueblade.com> wrote:
Thanks, Giampaolo. Could you leave a comment on the issue?
Erci On 5/25/2020 10:32 AM, Giampaolo Rodola' wrote:
I'm -1 because the concept of "timeout" is generic enough to be often implemented as a custom exception, which poses questions re. backward/forward compatibilty. E.g. in psutil I have "TimeoutExpired", also providing a "seconds" attribute. Also I've probably never seen ETIME / ETIMEDOUT happening, whereas AFAIU the point PEP 3151 was to create mappings for the most common errnos.
On Sun, May 24, 2020 at 6:48 PM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/
-- Giampaolo - http://grodola.blogspot.com
-- Giampaolo - http://grodola.blogspot.com

Sigh! I misread this discussion and thought the proposal was to add TimeoutError which I forgot existed. Sorry for the noise and please disregard my previous message. On Mon, May 25, 2020 at 4:32 PM Giampaolo Rodola' <g.rodola@gmail.com> wrote:
I'm -1 because the concept of "timeout" is generic enough to be often implemented as a custom exception, which poses questions re. backward/forward compatibilty. E.g. in psutil I have "TimeoutExpired", also providing a "seconds" attribute. Also I've probably never seen ETIME / ETIMEDOUT happening, whereas AFAIU the point PEP 3151 was to create mappings for the most common errnos.
On Sun, May 24, 2020 at 6:48 PM Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
*ETIME *Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) <http://man7.org/linux/man-pages/man2/ioctl.2.html> timeout".)
*ETIMEDOUT *Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
Eric
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/
-- Giampaolo - http://grodola.blogspot.com
-- Giampaolo - http://grodola.blogspot.com

On 24 May 2020, at 17:42, Eric V. Smith <eric@trueblade.com> wrote:
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT.
http://man7.org/linux/man-pages/man3/errno.3.html says:
ETIME Timer expired (POSIX.1 (XSI STREAMS option)).
(POSIX.1 says "STREAM ioctl(2) timeout".)
ETIMEDOUT Connection timed out (POSIX.1-2001).
It seems like a reasonable change to me, but I'm not a subject matter expert on STREAMS, or what other affect this might have.
And if added to 3.10, should it be backported? I'd tend to say "no", because of unknown impacts on existing code.
What kernel calls return this errno? What is the current behaviour of thoses kernel calls? Barry
Eric
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/C7KK6VSG... Code of Conduct: http://python.org/psf/codeofconduct/
participants (8)
-
Antoine Pitrou
-
Barry
-
Cameron Simpson
-
Eric V. Smith
-
Giampaolo Rodola'
-
Gregory P. Smith
-
Nathaniel Smith
-
Serhiy Storchaka