debugpy.configure(python=) is not properly documented
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- documentation
Research direction
Start with the documentation for debugpy.configure(python=), along with the listening setup using debugpy.listen and debugpy.wait_for_client. Check how sys.executable behaves in a hosted or embedded Python environment, then document the recursion or connection failure and the expected executable configuration.
Written by the indexing model from the issue text.
Description
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
- debugpy version: XXX (run
import debugpy; print(debugpy.__version__)if uncertain) - OS and version: XXX
- Python version (& distribution if applicable, e.g. Anaconda): XXX
- Using VS Code or Visual Studio:
Actual behavior
The parent program seemingly recursively gets created and started as a process without any easy way to kill the large number of processes created.
Expected behavior
It attached and works...
Steps to reproduce:
- Embed python into a program using the C API.
- Make a top level script that includes debugpy debugging... import debugpy, debugpy.listen, debugpy.wait_for_client, etc..
- Have parent program run and execute the top level script.
Not sure if this is a bug or is explained elsewhere. I am not going to spend the time to get involved and go through the forum. I am only leaving this here as a "gotcha" for a lonely passerby who ends up in the same scenario. Please edit / move as necessary.
In my use case, I want debugpy debugger support in a hosted (embedded) python environment. The user calls the user program and not python.exe. As such, sys.executable gets set to the exe of the program and not the expected python.exe. Why does this cause an infinite process recursion or fail to connect to the client debugger?

That would be why.
Moral of the story is.. make sure your sys.executable is set to python.exe in the hosted environment before using debugpy with the listening setup.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 202
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in microsoft/debugpy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100