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

2020-05-24 Thread 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)  
  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-le...@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/C7KK6VSGPQKPA5IUCZ2MHH7QNLP2Q5QX/
Code of Conduct: http://python.org/psf/codeofconduct/


[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.
>
> 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.
>
> Eric
>
>  ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@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/C7KK6VSGPQKPA5IUCZ2MHH7QNLP2Q5QX/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/KF66ZEH55RXJSMTNP5B37NS2O2WY6AGZ/
Code of Conduct: http://python.org/psf/codeofconduct/


[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 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 

On 24May2020 14:59, Gregory P. Smith  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  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.

Eric

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/NZO4PTIZ4JA3C6EXY3XEAP2K7LU4SSXJ/
Code of Conduct: http://python.org/psf/codeofconduct/


[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 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 

On 24May2020 14:59, Gregory P. Smith  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  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.

Eric

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/OLXOND24L75VWFZRYXA2UUIGMFMJ2Z6W/
Code of Conduct: http://python.org/psf/codeofconduct/