os.mkdir()
is implemented in C code and pdb
cannot step into that function.
You are limited to debugging pure Python code only; it doesn't matter if that code is part of the standard library or not. You can step into the shutil
module, or os.path
just fine, for example.
os.mkdir()
has to call into native code because it interacts with the OS; even PyPy has to defer to the underlying (host-Python) os.mkdir()
call to handle that part, so you cannot step into it with pdb
even in PyPy. In fact, just like in CPython, that part of the standard library is part of the RPython runtime and not seen as 'native Python code' by PyPy either, just like the built-in types are part of the runtime environment.
You could run the PyPy interpreter untranslated (so not statically compile the RPython code but have Python run the PyPy interpreter directly), but that'll only give you access to the RPython code paths, not the os.mkdir()
C code.