[issue39673] TimeoutError

2020-02-18 Thread YoSTEALTH
YoSTEALTH added the comment: If nothing else, it could be a feature of next Python release as its appropriate that `TimeoutError` catches both `ETIME` and `ETIMEDOUT`. -- versions: +Python 3.9 -Python 3.8 ___ Python tracker

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith 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);

[issue39673] TimeoutError

2020-02-18 Thread YoSTEALTH
YoSTEALTH added the comment: I am on Linux 5.5.2-1-MANJARO >>> sorted(errno.errorcode.items()) [(1, 'EPERM'), (2, 'ENOENT'), (3, 'ESRCH'), (4, 'EINTR'), (5, 'EIO'), (6, 'ENXIO'), (7, 'E2BIG'), (8, 'ENOEXEC'), (9, 'EBADF'), (10, 'ECHILD'), (11, 'EAGAIN'), (12, 'ENOMEM'), (13, 'EACCES'), (14,

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: Ah, I see. What platform are you on, and what's the value of errno.ETIMEDOUT? On cygwin I get: >>> errno.ETIMEDOUT 116 On a native Windows build I get: >>> errno.ETIMEDOUT 10060 and on Fedora I get: >>> errno.ETIMEDOUT 110 If you use errno.ETIMEDOUT

[issue39673] TimeoutError

2020-02-18 Thread YoSTEALTH
YoSTEALTH added the comment: First example prints # Failed: [Errno 62] Timer expired Second example prints # Success: [Errno 11] Resource temporarily unavailable -- ___ Python tracker

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: In both examples, what's being printed? It's not clear from your messages. -- ___ Python tracker ___

[issue39673] TimeoutError

2020-02-18 Thread YoSTEALTH
YoSTEALTH added the comment: Since I provide `OSError` with appropriate `errono`, it raises that error for example: import os try: no = -11 raise OSError(-no, os.strerror(-no)) except BlockingIOError as e: print('Success:', e) # Success: [Errno 11] Resource temporarily

[issue39673] TimeoutError

2020-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: I don't see why it would. You're raising OSError, which is not a subclass of TimeoutError, so the TimeoutError code is not executing. You don't say, but I assume this is what you think should happen. The exception handling machinery does not look inside a

[issue39673] TimeoutError

2020-02-18 Thread YoSTEALTH
New submission from YoSTEALTH : import os try: no = -62 raise OSError(-no, os.strerror(-no)) except TimeoutError: print('Success') except OSError as e: print('Failed:', e) # Failed: [Errno 62] Timer expired Shouldn't `TimeoutError` catch this error? -- messages: