GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ignore_module/unignore_module commands to pdb · Issue #139721 · python/cpython

Add ignore_module/unignore_module commands to pdb #139721

New issue
Copy link
New issue
Copy link
Open
Open
Add ignore_module/unignore_module commands to pdb#139721
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@ktowen
ktowen
opened on Oct 7, 2025
Issue body actions

Feature or enhancement

Proposal:

Add two new commands to the Python debugger (pdb) to ignore and unignore specific modules when navigating frames.
Those commands allows to use wildcards to ignore submodules too.

  • ignore_module [module_name] - Add modules to skip during debugging
  • unignore_module [module_name] - Remove modules from the skip list

When debugging applications we often need to step through deep stack traces from third party libraries that are hard to navigate and makes focusing on our code harder, requiring to manually go up or down to find our code.

There is a similar implementation on ipython ipython/ipython#14973

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-139721: Add ignore_module/unignore_module commands to pdb #139724

Activity

  1. ktowen
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Oct 7, 2025
  2. StanFromIreland
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Oct 7, 2025
  3. ktowen
    added 5 commits that reference this issue on Oct 7, 2025

    pythongh-139721: Add ignore_module/unignore_module commands to pdb

    f607f22

    pythongh-139721: Add ignore_module/unignore_module commands to pdb

    401e1e3

    pythongh-139721: Add ignore_module/unignore_module commands to pdb

    ac97b3b

    pythongh-139721: Fix pdbcommand regex to support underscores

    96f6941

    pythongh-139721: Add skip message to stop_here for ignored modules

    e3d97d0
  4. gaogaotiantian commented on Oct 9, 2025

    @gaogaotiantian
    gaogaotiantian
    on Oct 9, 2025
    Member
    More actions

    Okay so I'm always a bit hesitated when we try to add extra commands to pdb because we can't revert it. I'm not saying we should never do that, just want to make sure it's something that a reasonable amount of users need.

    To be honest, I don't like the skip argument of Pdb - it makes things complicated. Any "exceptional rules" will face the problem of conflict rules. For example, we just fixed an issue when an explicit inline breakpoint is in a "skipped" module (#130493). What would be the expected behavior? Who gets higher priority?

    gcc has a similar command skip (and if we are to add this, we should name it skip too). lldb does not have anything like this as far as I know.

    I also disagree that up and down should be impacted by this. skipping a boring module in control is different than not able to inspect it.

    BTW if I read your implementation correctly, it will fill the user's terminal with warnings when it enters a skipped module. You are printing something in stop_here.

    So here's my suggestion - write a post in d.p.o. and see if the community is interested in such a feature. At least get a few supporters before we make this in pdb permanently.

    If we are to add this, keep the consistency as much as possible. We should have the same behavior as the skip argument. Have a single command skip to control everything. Do not mess with the inspection commands.

    Reacted by ktowen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.