[PyKDE] problem with exceptions within events

Toby Dickenson tdickenson at devmail.geminidataloggers.co.uk
Thu Feb 24 10:06:01 GMT 2005


On Thursday 24 February 2005 00:44, Giovanni Bajo wrote:

> I reckon you have slightly misunderstood my problem.

I had misunderstood it too. 

> The problem is: when the exception is raised from within the overriden
> method of an event handler (as opposed to an exception raised from within
> the constructor of a subclass, or from within a slot called by a signal),
> the exception is *totally* ignored. There is no acknowledgement
> whatsoever. Nothing. Nada. I have no way to know that my code did not
> work.

Ive attached a test script based on your original report. I cant reproduce the 
problem here with sip 4.0.1, PyQt 3.1.2, qt 3.3.3

> I would expect the
> exception raised by the event handler to call our custom excepthook just
> like other exceptions raised in different contexts, but it would be fine
> if it *just* printed something on the console. 

Agreed.

-- 
Toby Dickenson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.py
Type: application/x-python
Size: 750 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050224/ca0c0681/error.bin
-------------- next part --------------
about to send event....
in event handler....
Traceback (most recent call last):
  File "error.py", line 8, in customEvent
    1/0 # gratuitous exception.... lets see how it gets handled
ZeroDivisionError: integer division or modulo by zero
you should see an exception logged above


about to post event, should see nothing yet....
about to process that event....
in event handler....
Traceback (most recent call last):
  File "error.py", line 8, in customEvent
    1/0 # gratuitous exception.... lets see how it gets handled
ZeroDivisionError: integer division or modulo by zero
you *should* see the same exception logged again.
"Giovanni Bajo" <rasky at develer.com> reports that it is omitted




More information about the PyQt mailing list