Re: [Python-ideas] Introduce BaseTimeoutError

2017-04-02 Thread Nathaniel Smith
On Sun, Apr 2, 2017 at 4:08 PM, Terry Reedy wrote: > Both are subclasses of OSError but mean different things. TimeoutError > means that something in 'your system' did not respond. Socket.timeout means > that a foreign system did not respond. (I am leaving out a local socket > connection.) The

Re: [Python-ideas] Introduce BaseTimeoutError

2017-04-02 Thread Terry Reedy
On 4/1/2017 3:27 PM, Ram Rachum wrote: Today I got burned because I had code that did this: except TimeoutError: When it should have done this: except socket.timeout: Both are subclasses of OSError but mean different things. TimeoutError means that something in 'your system' did no

Re: [Python-ideas] Introduce BaseTimeoutError

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 1:11 PM, Steven D'Aprano wrote: > On the face of it, this isn't a serious problem. It seems to me rather > like mistakenly writing: > > except TypeError > > when you actually intended to write: > > except ZeroDivisionError > > You failed to catch the exception that y

Re: [Python-ideas] Introduce BaseTimeoutError

2017-04-01 Thread Steven D'Aprano
On Sat, Apr 01, 2017 at 09:27:34PM +0200, Ram Rachum wrote: > Today I got burned because I had code that did this: > > except TimeoutError: > > When it should have done this: > > except socket.timeout: On the face of it, this isn't a serious problem. It seems to me rather like mistaken

[Python-ideas] Introduce BaseTimeoutError

2017-04-01 Thread Ram Rachum
Today I got burned because I had code that did this: except TimeoutError: When it should have done this: except socket.timeout: There's also another timeout error class in asyncio. Initially I thought, why not make them all use the same exception class? But Guido objects to that: I co