简体   繁体   中英

Visual Studio Code debug python script with ampersand in file path

I am using VS Code and debugging a python script. I'm in a conda environment. 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.

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.

这已被验证为错误

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM