Message32523
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:58:42 | admin | link | issue1755388 messages |
2007-08-23 14:58:42 | admin | create | |
|