python / cpython

The Python programming language
https://www.python.org
Other
63.12k stars 30.22k forks source link

"pdb.Pdb(skip=…).set_trace()" should always stop on calling frame #82987

Open 1f7c169c-a6ad-45ae-b614-0d40d962c776 opened 4 years ago

1f7c169c-a6ad-45ae-b614-0d40d962c776 commented 4 years ago
BPO 38806
Nosy @blueyed
PRs
  • python/cpython#17159
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['3.7', '3.8', 'type-bug', 'library', '3.9'] title = '"pdb.Pdb(skip=\xe2\x80\xa6).set_trace()" should always stop on calling frame' updated_at = user = 'https://github.com/blueyed' ``` bugs.python.org fields: ```python activity = actor = 'blueyed' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'blueyed' dependencies = [] files = [] hgrepos = [] issue_num = 38806 keywords = ['patch'] message_count = 1.0 messages = ['356638'] nosy_count = 1.0 nosy_names = ['blueyed'] pr_nums = ['17159'] priority = 'normal' resolution = None stage = 'patch review' status = 'open' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue38806' versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9'] ```

    1f7c169c-a6ad-45ae-b614-0d40d962c776 commented 4 years ago

    The following will not stop for debugging:

    python3.8 -c 'import pdb; pdb.Pdb(skip=["__main__"]).set_trace()'

    The example is contrived, the real case would be to have some "noisy" module being excluded in general, but when you add an explicit "set_trace()" in there it should still stop there, and not on some upper frame.

    This was changed a long time already in https://github.com/python/cpython/commit/313a7513b0c5771042d850d70782a2448d1cdcb7 (Python 2.3), but it is not really clear.

    I will create a PR reverting that part and see how it goes.