-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Description
I expect that the source file can be specified in VSCode when prompted as follows:
Could not load source '<string>': Unable to retrieve source for <string>.
Expect to be able to debug myCode.py and pause at the breakpoint method,When VSCode cannot find the source file, the developer can manually specify the source file.
Test case:
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Eval Debug",
"type": "python",
"request": "attach",
"listen": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
]
}myCode.py
import debugpy
print("Waiting for debugger attach")
debugpy.connect(('localhost', 5678))
debugpy.breakpoint()
print("Then End")Test.py
f = open('./myCode.py')
code = f.read()
f.close()
compiled = compile(code,'<string>','exec')
exec(compiled)Metadata
Metadata
Assignees
Labels
No labels