This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ggenellina
Recipients
Date 2007-07-19.21:37:34
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I can reproduce the bug on Windows XP SP2, a simpler program is attached.

First run, I did not press Ctrl-C:

c:\temp>python bug1.py
enter test, gethostbyname('e.p.l.w.d.com')
Yo can press Ctrl-C
inner try
<type 'type'> <class 'socket.gaierror'> False
outer try
<type 'type'> <class 'socket.gaierror'> False
exit test

The inner try/except catches the exception as expected.

Second run, I *did* press Ctrl-C:

c:\temp>python bug1.py
enter test, gethostbyname('s.g.s.w.s.com')
Yo can press Ctrl-C
outer try
<type 'type'> <type 'exceptions.KeyboardInterrupt'> True
exit test

The inner try/except didn't catch the exception, and it propagates to the outer one. I don't understand why; even if the gethostbyname call is blocking, and Ctrl-C is not detected until it returns, there IS an exception raised (either KeyboardInterrupt or socket.gaierror) in the inner block that should be handled by the inner except clause.
History
Date User Action Args
2007-08-23 14:58:42adminlinkissue1755388 messages
2007-08-23 14:58:42admincreate