[PyQt] Bug in PyQt5.Qt

Kovid Goyal kovid at kovidgoyal.net
Fri Jun 13 17:42:15 BST 2014


Hi Phil,

Reading the source code of the PyQt5.Qt module, it is supposed to work
even if some of the PyQt modules are missing. It does not. For example,
remove the QtMultimedia.so module and run

python -c "from PyQt5.Qt import QStyle"

This raises an import error. But

python -c "import PyQt5.QtWidgets; from PyQt5.Qt import QStyle"

works.

My best guess is that PyImport_ImportModule requires PyErr_Clear()
between invocations. (I am away from my dev machine and cant test it
right now). 

I'd appreciate if this could be fixed as it breaks calibre on linux
distros where PyQt is only partially installed. I am working around it
for the moment by importing PyQt5.QtWebKitIwdgets very early in calibre
initialization, but this is less than optimal for obvious reasons.

I could implement a more robust solution by implementing a meta import
hook, but I'd rather not spend the time on that if it can be fixed
simply in PyQt5.

Thanks,

Kovid.

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140613/1c2967c6/attachment.sig>


More information about the PyQt mailing list