Open roteiro opened 2 months ago
I'm experiencing the same issue. "Debug File (Ctrl+F5)" ignores all working directory settings. I have a local module and when I try to debug the module the working directory immediately changes to that of the module where I want it to stay at the currently working directory. "Run (F5)" works as intended as set in the configuration. I'm unable to debug local modules in Spyder 6. This is an issue in 6.0.0 and 6.0.1.
Same issue, "command line options" are ignored when using the Debugger. If I use Run file (F5) with "run this file in:" Debugger, debugger starts with command line options but the breakpoints are ignored. If I use Debug file (Ctrl-F5), debugger starts, breakpoints work but command line options are ignored.
I cannot debug with command line options.
Hi @roteiro thank you for the report! Checking seems like the *** NameError: name '_pdbcmd_print_frame_status' is not defined
is related with #22500 . Related with the working directory config/settings what do you think @ccordoba12 @impact27 ? I think for the moment, as a workaround, you should be able to run manually the debugfile
magic and provide the appropiate working dir running something like %debugfile <file path> --wdir <working dir path>
(maybe that could help you too @mvillion and @glindstr)
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?
I would say no, sorry :/ the closes thing you could do currently is to set the global config to use the Working directory settings > The current working directory
. Then when you have a project loaded the project path will be used as the current working directory and, if you want to use a specific path inside the project, manually change the working dir using the working directory toolbar. However, is there something else that could be done currently for something like that @ccordoba12 ?
However, is there something else that could be done currently for something like that?
I think we should pass the working directory to the %debugfile
magic, as you pointed out above. It shouldn't be that hard to do.
[ These commands were working in Spyder 5: In [5]: runfile("/home/user/test.py", args="--feat=027b") --> ok In [6]: debugfile("/home/user/test.py", args="--feat=027b") UsageError: unrecognized arguments: args=--feat=027b) ]
The suggested workaround is working: %debugfile /home/user/test.py --args="--feat=027b" 👍
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