larray-project / larray-editor

Graphical User Interface for LArray
GNU General Public License v3.0
2 stars 2 forks source link

Debugger warning on Python 3.11 #263

Closed gdementen closed 1 year ago

gdementen commented 1 year ago

Running the editor in Python 3.11 produces the following warning:

0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

I already ruled out a bad interaction with PyCharm (we get the same result when running outside of PyCharm).

In our code, it seems like this line is the culprit:

kernel_manager = QtInProcessKernelManager()

It seems like the qtconsole somehow uses debugpy where the warning originates but even though there are many issues/discussions about this issue floating around on the internet, I found no convincing solution so far. The consensus so far seems to be to just ignore the error, or silence the warning by doing as the warning suggests. Passing the extra option to Python is a no-go for us (as we don't want users to have to mess with that), and setting the environment variable seems an ugly solution, but could be worth a try (setting it from within Python, before we instantiate the kernel manager as above).

Reference: https://github.com/fabioz/PyDev.Debugger/issues/213