Problem loading Qt Designer plugins from different directories
ivan.sinkarenko at cern.ch
Thu Aug 20 15:25:43 BST 2020
I've found a bug in libpyqt5.so loader, namely inside
1. Consider having 2 plugins in separate directories:
/path/to/first/my_plugin.py; /path/to/second/my_plugin.py, and loading
that into Qt Designer simultaneously, e.g.
2. PyCustomWidgets::importPlugins function will be called twice with
arguments ("/path/to/first", "my_plugin") and ("/path/to/second",
3. The first argument (paths) are added to sys.modules
4. The second argument is given to PyImport_ImportModule. But because
both are named "my_plugin", only the first plugin will be loaded. The
second time it will skip import, as Python always does to modules.
5. In Qt Designer, you will find 2 entries of the same plugin under
Not too critical (as can be circumvented by always having unique
filenames), but was quite unexpected to find.
More information about the PyQt