Skip to content

FileNotFoundError on hallucinated site-packages path when starting debug session in VSCode #21250

Answered by brettcannon
hheimbuerger asked this question in Q&A
Discussion options

You must be logged in to vote

Was this exception for some reason to be expected, and I just got stuck on it, because I had 'stop on all breakpoints' enabled?

Ah, that's the key detail. So this is expected because Python's stdlib is "library code", and runpy is raising an exception by doing EAFP-style ("easier to ask forgiveness than permission") programming which is totally legitimate (notice how the line you broke on is in a try block).

So everything is working as expected, but you're discovering how noisy "stop on all breakpoints" can be when you include code you don't control which may use a coding style which isn't amenable to "stop on all breakpoints".

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hheimbuerger
Comment options

Comment options

You must be logged in to vote
3 replies
@brettcannon
Comment options

Answer selected by hheimbuerger
@hheimbuerger
Comment options

@brettcannon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants