[英]Visual Studio Code debug python script with ampersand in file path
I am using VS Code and debugging a python script. 我正在使用VS Code并调试python脚本。 I'm in a conda environment. 我处于conda环境中。 I start debugging, and at each line of execution, I get an error like this: 我开始调试,在执行的每一行,都会出现如下错误:
Unable to open 'filename.py': File not found (file:///s:/path/word&morewords/etcetc/filename.py).
To be clear, this file that VS cannot find is the very same .py file that I have open in VS and am debugging. 需要明确的是,VS无法找到的该文件与我在VS中打开并正在调试的.py文件完全相同。
It appears that where the ampersand occurs, it looks for " &
" instead of just "&". 看起来在出现&符的地方,它查找的是“ &
”,而不仅仅是“&”。 But the debugger works, insofar as it evaluates lines and gives results. 但是,调试器在评估行并给出结果的范围内仍然有效。 But at each line step, the error pops open again. 但是在每一行步骤中,错误再次弹出。 Changing the file path isn't really an option. 更改文件路径并不是真正的选择。
The actual path is: 实际路径为:
s:/path/word&morewords/etcetc/filename.py
How can I make this error not happen? 如何使此错误不会发生?
Also, the line that is being executed is not highlighted when I am running the debugger. 另外,当我运行调试器时,正在执行的行未突出显示。 So, I have no idea where I am unless I keep track. 因此,除非跟踪,否则我不知道自己在哪里。 Perhaps these issues are related, but I am not sure. 也许这些问题是相关的,但我不确定。
这已被验证为错误 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.