You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The python interpreter is set to path/to/testproject/.venv/Scripts/python.exe. I want to run foo.py from the dir testproject , therefore, i set the following run configuration under Run->Configuration per File
Content of foo.py
if __name__ == "__main__":
print("test")
raise ValueError
What steps reproduce the problem?
I tried two different ways of running the file:
a) Run foo.py with F5
b) Debug foo.py with Ctrl+F5
What is the expected output? What do you see instead?
a)
I expect to to automatically enter the debugger due to the run configuration and the deliberate ValueError. This basically happens, except for the unexpected *** NameError: name '_pdbcmd_print_frame_status' is not defined
Full output of a)
In [1]: %runfile C:/Users/path/to/testproject/scripts/foo.py --wdir C:/Users/path/to/testproject/testproject --post-mortem
test
Traceback (most recent call last):
File ~\path\to\testproject\.venv\Lib\site-packages\spyder_kernels\customize\utils.py:209 in exec_encapsulate_locals
exec_fun(compile(code_ast, filename, "exec"), globals)
File c:\users\path\to\testproject\testproject\scripts\foo.py:3
raise ValueError
ValueError
****************************************
Entering post mortem debugging...
****************************************
*** NameError: name '_pdbcmd_print_frame_status' is not defined
IPdb [1]:
b) I expect the execution with the wdir set to the project root and the lauch of the debugger. However, the Working directory settings seem to be ignored for Ctrl+F5, since the working directory is changed to the folder scripts
Full output of b)
In [3]: %debugfile C:/Users/path/to/testprojct/testproject/scripts/foo.py --wdir
*** NameError: name '_pdbcmd_print_frame_status' is not defined
IPdb [1]:
Bonus Question
Is it correct that at the moment, there is no possibility to set the global run configuration such that the wdir is relative to the currently opened Spyder project?
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
Consider the following project structure of the folder
testproject
The python interpreter is set to
path/to/testproject/.venv/Scripts/python.exe
. I want to runfoo.py
from the dirtestproject
, therefore, i set the following run configuration underRun->Configuration per File
Content of
foo.py
What steps reproduce the problem?
I tried two different ways of running the file:
a) Run foo.py with F5
b) Debug foo.py with Ctrl+F5
What is the expected output? What do you see instead?
a)
I expect to to automatically enter the debugger due to the run configuration and the deliberate ValueError. This basically happens, except for the unexpected
*** NameError: name '_pdbcmd_print_frame_status' is not defined
Full output of a)
b) I expect the execution with the wdir set to the project root and the lauch of the debugger. However, the Working directory settings seem to be ignored for
Ctrl+F5
, since the working directory is changed to the folderscripts
Full output of b)
Bonus Question
Is it correct that at the moment, there is no possibility to set the global run configuration such that the wdir is relative to the currently opened Spyder project?
Versions
Dependencies
The text was updated successfully, but these errors were encountered: