Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1
Newer versions of debugpy come with a bundled pydevd that complains about >=python-3.11's frozen core modules. This causes a doctest failure, File "sage/repl/ipython_kernel/kernel.py", line 48, in sage.repl.ipython_kernel.kernel.SageKernel.__init__ Failed example: from sage.repl.ipython_kernel.kernel import SageKernel Expected nothing Got: 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. The issue is simply that, with the core modules frozen, the user cannot place breakpoints in them. The warning however is displayed whenever you import debugpy, which happens inside ipykernel, i.e. whenever we merely import SageKernel. Taking the warning's advice, we set PYDEVD_DISABLE_FILE_VALIDATION=1 in src/bin/sage-env to hide the untimely warning. This does nothing to change the status quo (you couldn't put breakpoints in frozen modules before and now you still can't), but it fixes the doctest failure and makes the old/new versions of debugpy behave consistently.
- Loading branch information