[Twisted-Python] Qtreactor problem on twisted 2.1

Umit Oztosun umit at liqia.com
Sat Dec 31 06:37:44 EST 2005


On 12/30/05, James Y Knight <foom at fuhm.net> wrote:
> For some reason, the stack trace looks truncated, since it starts
> with defer.py:addCallbacks. But my guess is that read is getting
> called re-entrantly. By calling exec_loop within a callback, you're
> causing the reactor to loop within another reactor loop, and the
> reactor isn't designed to ensure it's safe to do that. Is it possible
> to change the code to show a dialog box without running a sub-loop?

Well, our dialog is a custom widget derived from QDialog. Displaying
the dialog without exec_loop is not a problem, but in order to receive
and process GUI events, one should somehow call qApp.processEvents()
or a similar call. Otherwise GUI basically locks up. I constructed a
dummy loop periodically calling qApp.processEvents() in order to
simulate the exec_loop behaviour. However, the problem still persists.
After a few seconds after the dialog is displayed, the "Non-list
expression received" exception is fired.

I even tried "qApp.eventLoop().processEvents(QEventLoop.ExcludeSocketNotifiers)"
in order to only process user input events, but this again didn't

This does not always happen, but happens quite occasionally. To
emphasize again, problem does not exist when using twisted 1.3. I also
tried to connect a twisted 2.1 server with a twisted 1.3 client, and
it was still OK.

Umit Oztosun

More information about the Twisted-Python mailing list