[PySide] PySide Pitfalls

Florian Bruhin me at the-compiler.org
Tue Sep 16 15:56:45 CEST 2014


Hi again,

* Nathan Warmerdam <nathan.warmerdam at gmail.com> [2014-09-15 12:57:46 -0700]:
> 2. I've used some logging to figure out when the crash occurs and more
> often than not it happens when my main window is constructing a new dialog
> to open.  I pass a pretty simple python class between the two.  Should I
> refrain from doing that?

Showing the exact code might help.

Also, I've found using a trace function (which prints every line
executed) is very useful for debugging segfaults.

Here is the one I use:

http://git.the-compiler.org/qutebrowser/tree/qutebrowser/utils/debug.py?id=6b8c597d18532d5c8ff33f380c43e8afbec8d56c#n93

utils.compact_text used there just removes newlines and elides long
texts, it's defined here:

http://git.the-compiler.org/qutebrowser/tree/qutebrowser/utils/utils.py?id=4caec2becbfb7156d58643ec083106adf3f31633#n41

Also using the faulthandler module helps a lot if the crash is
happening outside the Qt mainloop as well, as it prints the Python
stacktrace during a segfault.

For python3.3+:
https://docs.python.org/dev/library/faulthandler.html

For older versions:
https://pypi.python.org/pypi/faulthandler/

> 3. I use the Designer to create my window/dialog and call setupUi.  Is this
> known to be stable?

I've never had problems with that.

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
             GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20140916/6beb460d/attachment.sig>


More information about the PySide mailing list