Environment data
- debugpy version: 1.8.16
- OS and version: macOS 15.6.1
- Python version (& distribution if applicable, e.g. Anaconda): 3.11.13
- Using VS Code or Visual Studio: VS Code
Steps to reproduce:
- Create a file
somepackage/__init__.py with content print("first")
- Create a file
somepackage/main.py with content print("second")
- Set breakpoints in both files
- Debug the
somepackage.main module either from VS Code or by running: python -m debugpy --listen localhost:5678 --wait-for-client -m somepackage.main
Note that the __init__ module is executed automatically before the main module.
Sample: https://github.com/ashenstrata/sample-debugpy-1
Actual behavior
The debugger skips __init__.py and "first" always gets printed. Only after that, the debugger kicks in and pauses execution (either at the second breakpoint or because of --wait-for-client).
Expected behavior
The debugger initiates before __init__.py is executed, and stops at the first breakpoint.
Environment data
Steps to reproduce:
somepackage/__init__.pywith contentprint("first")somepackage/main.pywith contentprint("second")somepackage.mainmodule either from VS Code or by running:python -m debugpy --listen localhost:5678 --wait-for-client -m somepackage.mainNote that the
__init__module is executed automatically before themainmodule.Sample: https://github.com/ashenstrata/sample-debugpy-1
Actual behavior
The debugger skips
__init__.pyand "first" always gets printed. Only after that, the debugger kicks in and pauses execution (either at the second breakpoint or because of--wait-for-client).Expected behavior
The debugger initiates before
__init__.pyis executed, and stops at the first breakpoint.