Skip to content

bpo-41607: Print clickable path to breakpoint in pdb #22964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arturtamborski
Copy link

@arturtamborski arturtamborski commented Oct 25, 2020

Issue: https://bugs.python.org/issue41607

The pdb module prints path to breakpoint in a rather unique way:

--Return--
> /home/artur/code/test.py(3)<lambda>()->None
-> asd = lambda: pdb.set_trace()
(Pdb) locals()

This patch changes it to print it similarly to traceback:

--Return--
  File "/home/artur/code/test.py", line 3, in <lambda>
->  asd = lambda: pdb.set_trace()
(Pdb) locals()

thus making the line clickable in many popular code editors.

https://bugs.python.org/issue41607

The pdb module prints path to breakpoint in a rather unique way:

    --Return--
    > /home/artur/code/test.py(3)<lambda>()->None
    -> asd = lambda: pdb.set_trace()
    (Pdb) locals()

This patch changes it to print it similarly to traceback:

    --Return--
      File "/home/artur/code/test.py", line 3, in <lambda>
    ->  asd = lambda: pdb.set_trace()
    (Pdb) locals()

thus making the line clickable in many popular code editors.
@arturtamborski arturtamborski force-pushed the bpo-41607-traceback-like-paths-to-breakpoints-in-pdb branch from 1265977 to dfcb04c Compare October 25, 2020 12:21
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Dec 16, 2020
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see failures on all platforms, can you check why this is and fix, please?

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jul 30, 2022
@@ -543,7 +543,7 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
import linecache, reprlib
frame, lineno = frame_lineno
filename = self.canonic(frame.f_code.co_filename)
s = '%s(%r)' % (filename, lineno)
s = 'File "%s", line %r, in ' % (filename, lineno)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this covered by any tests?

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@encukou
Copy link
Member

encukou commented Mar 19, 2024

The issues is closed with a reason. I'll close the PR as well. Please comment on the issue if you disagree.

@encukou encukou closed this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants