简体   繁体   English

在文件路径中带有&符号的Visual Studio Code调试python脚本

[英]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.

相关问题 Visual Studio Code:如何使用参数调试 Python 脚本 - Visual Studio Code: How debug Python script with arguments 在 Visual Studio Code 中为文件“launch.json”设置 Python 路径 - Setting the Python path in Visual Studio Code for file 'launch.json' Visual Studio Code调试模式可以识别文件路径,但是普通模式会显示“没有这样的文件或目录”? - Visual Studio Code debug mode recognizes file path, but normal mode says “No such file or directory”? 使用Visual Studio Code在ROS中调试python脚本 - python scripts debug in ROS with Visual Studio Code 如何在 Visual Studio Code 中调试 python 单元测试? - how to debug python unittests in Visual Studio Code? Visual Studio代码,Python运行/调试 - Visual Studio Code, Python Run/Debug 在Visual Studio Code中运行Node.js,将python脚本作为子进程调用并对其进行调试 - In Visual Studio Code run Node.js, call python script as child-process and debug it Python Visual Studio 代码的路径问题 - Python path issue with Visual studio code Visual Studio Code Python路径设置不正确 - Visual Studio Code Python path set incorrectly 将 python 路径添加到 Visual Studio 代码中的模块 - add a python path to a module in visual studio code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM