[PyQt] debugging pyqtdeployed apps

Phil Thompson phil at riverbankcomputing.com
Fri May 23 11:27:58 BST 2014


On 20/05/2014 4:01 pm, lloyd konneker wrote:
> Again I have an issue where my pyqtdeploy'd app does not behave like
> it does when not deployed.  What debugging techniques should I use?
> 
> Specifically, my app under certain conditions doesn't seem to receive
> a closeEvent when the user clicks on the close icon in the upper right
> corner of the app mainWindow.  This is on Ubuntu 13.10 or 14.04 Gnome,
> Qt5.2.1, Python3.4, PyQt5.  (I suppose it could be a window manager
> issue but I can't yet test pyqtdeploy on OSX or Win.)
> 
> Would valgrind help?  My understanding is that freeze only
> encapsulates the Python byte code and doesn't really translate any
> code from Python to C.  I am imagining some error in the
> wrapping/binding code that valgrind might find.
> 
> Also, my Python code has plenty of assertions, but I don't think
> pyqtdeploy would disable those?

It shouldn't at the moment - unless you have PYTHONOPTIMIZE set. A 
future version will allow you to disable them.

> My previous issue was that app.activeWindow() did not seem to return
> the same result as it did when not pyqtdeployed, so maybe I have just
> pushed around the same error, that there is still a race or an aspect
> of Qt that I don't understand.

A deployed application doesn't do anything different to a "traditional" 
application - PyQt is identical.

Regarding debugging then print() should work. I don't know how eric 
implements remote debugging (by including some stub code?), but I don't 
see why that can't continue to work.

Phil


More information about the PyQt mailing list