Demonstrates microsoft/debugpy#1954
You can run this right in the browser using GitHub Codespaces (green "Code" button -> Codespaces)
To execute the code:
./run_plain_python.sh
To run the debugpy server, making it wait for the debugger client to attach:
./run_debugpy.sh
This will reveal the bug — print the first line before the debugger kicks in.
To do the same from VS Code, execute the Python Debugger: Module
debug configuration.