[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-26 Thread Barry
> On 24 May 2020, at 17:42, Eric V. Smith 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

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-26 Thread Antoine Pitrou
On Mon, 25 May 2020 04:38:17 -0400 "Eric V. Smith" 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 >

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-26 Thread Giampaolo Rodola'
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' wrote: > I'm -1 because the concept of "timeout" is generic enough to be often

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Giampaolo Rodola'
Sure. Done. On Mon, 25 May 2020 at 21:05, Eric V. Smith 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,

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Eric V. Smith
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

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Giampaolo Rodola'
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,

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Eric V. Smith
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:    

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Nathaniel Smith
On Mon, May 25, 2020 at 1: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. > > > >

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Serhiy Storchaka
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

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-24 Thread Eric V. Smith
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

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-24 Thread Cameron Simpson
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

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-24 Thread Gregory P. Smith
Sounds like a natural fit, I'd just do it for 3.10. On Sun, May 24, 2020, 9:45 AM Eric V. Smith wrote: > Does anyone have an opinion on https://bugs.python.org/issue39673? It > maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT. > >