Saturday, 1 August 2026

Frozen Frames when Debugging Python

When running pdb, you will notice certain debugging frames as frozen.  This is typically when:
  • code is compiled C-extension code (e.g. importlib, asyncio, threading internals)
  • the debugger cannot step in or modify them
  • they are part of Python's frozen importlib bootstrap
For example, in the following:

<frozen importlib._bootstrap>
<frozen importlib._bootstrap_external>

The modules are embedded in the Python binary.

If you try ll in the Python debugger when compiled code is being processed, you will get the error: *** could not get source code.

No comments: