Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pdb cannot find source code for frozen stdlib modules #93696

Closed
Labels
3.10only security fixes3.11only security fixes3.12only security fixestopic-importlibtype-bugAn unexpected behavior, bug, or error
@SnoopJ

Description

@SnoopJ

Bug report

Context: this issue came out of a discussion in #python on the Libera.chat IRC network, where a user wanted to peek intoimportlib._bootstrap withpdb while chasing a bug.

pdb is capable of stepping into function calls into frozen modules, but thelist command cannot locate the source code necessary to display the source being stepped through.

# repro.pyimportimportlib._bootstrap# some function call that we want to step into with pdbimportlib._bootstrap._resolve_name("os",".",1)
$ python3 -m pdb repro.py> /home/snoopjedi/repro.py(2)<module>()-> import importlib._bootstrap(Pdb) n> /home/snoopjedi/repro.py(5)<module>()-> importlib._bootstrap._resolve_name("os", ".", 1)(Pdb) s--Call--> <frozen importlib._bootstrap>(883)_resolve_name()(Pdb) l[EOF]

Note that executingsource importlib._bootstrap from the frame that calls into this moduledoes successfully locate the source, but this isn't very useful to a user ofpdb.

I believe that bringing the frame'sco_filename into agreement with the module's__file__ would fix this issue without changes topdb (see#89815), but thought it would be good to track the issue withpdb in a separate ticket since that fix is more nuanced and I think I have an interim patch for the debugger.

Your environment

  • CPython versions tested on: 3.9.4, 3.11.0b3
  • Operating system and architecture: Ubuntu 20.04, x86_64

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixestopic-importlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp