Environment information
This bug has been hit during an ongoing effort to have Cutter being able to use Python plugins on NixOS: https://github.com/NixOS/nixpkgs/pull/101571 .
Describe the bug
When having two plugins under ~/.local/share/RadareOrg/Cutter/plugins/python, Cutter fails to load one of them with the following error:
Couldn't load module for plugin: "graphs_plugin_grid"
Traceback (most recent call last):
File "/nix/store/arf1pqiplym45bp448ar8li8r5253vnf-shiboken2-5.15.1/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 107, in _import
ValueError: call stack is not deep enough
Loaded 1 plugin(s).
Not sure if it's a Cutter bug, or if something is wrong with our build...
Is this expected behavior?
Can people on other platforms, or using pre-built binaries run into similar issues?
Yes, it's a known issue. I thought I made an issue for that, but looks like forgot to do it. Thanks for reminding it.
The problem is due to pyside developers trying to be clever and overriding import in a buggy way. Information about why they do it can be found here https://bugreports.qt.io/browse/PYSIDE-1019 .
Proper fix would be to fix the import hook in pyside. It would be nice to do before qt 5.15.2 gets released, who knows if there will be any more open source bugfix releases for qt 5.15. No idea how strict they are with with last minute bugfixes, so I am not sure if it realistic. To make things worse both - making a proper bugrreport and making PR - is a little bit tricky. Repeating the problem without Cutter will require making a test program which uses python C API. Making a PR to Qt requires dealing with their CLA and who knows what else.
Actual fix should as easy adding single if checking current stack size before taking values out of it.
Right after I prepared a test project I found that the issue has been reported and patch submitted. https://bugreports.qt.io/browse/PYSIDE-1398 It was done at the beginning of October so there is hope that fix will be included in 5.15.2 and the bug will only affect qt 5.15.0 and 5.15.1 .
Qt 5.15.2 is out. Tested on Archlinux which has the updated qt package, was able to load two copies of sample plugin.

Most helpful comment
Right after I prepared a test project I found that the issue has been reported and patch submitted. https://bugreports.qt.io/browse/PYSIDE-1398 It was done at the beginning of October so there is hope that fix will be included in 5.15.2 and the bug will only affect qt 5.15.0 and 5.15.1 .