Skip to content
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

toggle breakpoints in .txt file accidently #73

Open
oliveagle opened this issue May 31, 2013 · 3 comments
Open

toggle breakpoints in .txt file accidently #73

oliveagle opened this issue May 31, 2013 · 3 comments

Comments

@oliveagle
Copy link

I'm using vim-pudb to toggle breakpoints directly while editing the python file. Accidently, I press my shortcut keybinds to toggle a breakpoint on a .txt file. then pudb crashed. it throws out an syntax error.

[oliveagle@myhost python ]$ pudb test.py
Traceback (most recent call last):
File "/usr/local/share/python/pudb", line 9, in
load_entry_point('pudb==2013.2', 'console_scripts', 'pudb')()
File "/Library/Python/2.7/site-packages/pudb/run.py", line 30, in main
steal_output=options.steal_output)
File "/Library/Python/2.7/site-packages/pudb/init.py", line 24, in runscript
dbg = _get_debugger(steal_output=steal_output)
File "/Library/Python/2.7/site-packages/pudb/init.py", line 12, in _get_debugger
dbg = Debugger(**kwargs)
File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 151, in init
for bpoint_descr in load_breakpoints():
File "/Library/Python/2.7/site-packages/pudb/settings.py", line 409, in load_breakpoints
return parse_breakpoints(lines)
File "/Library/Python/2.7/site-packages/pudb/settings.py", line 375, in parse_breakpoints
if get_breakpoint_invalid_reason(filename, lineno) is None:
File "/Library/Python/2.7/site-packages/pudb/lowlevel.py", line 48, in get_breakpoint_invalid_reason
if lineno not in get_executable_lines_for_file(filename):
File "/Library/Python/2.7/site-packages/pudb/lowlevel.py", line 23, in get_executable_lines_for_file
codes = [compile("".join(getlines(filename)), filename, "exec")]
File "/usr/local/share/vim/vim73/doc/help.txt", line 1
help.txt For Vim version 7.3. Last change: 2010 Jul 20
^

pudb come back after delete that breakpoint in saved-breakpoints directly.

So. I think pudb should check whether a breakpoint is added from a .py file or not before save that breakpoint in 'saved-breakpoints' file. and handle exceptions gracefully while parsing breakpoints.

p.s.
It would be better to make it clear where to find those 'saved-breakpoints' file without dig into the source code.

@inducer
Copy link
Owner

inducer commented May 31, 2013

Makes sense, sorry for the trouble. I'm kind of swamped right now, but I'd be happy to take a patch.

@asmeurer
Copy link
Collaborator

I added an item to the FAQ about where breakpoints are stored in #74. See what you think.

@oliveagle
Copy link
Author

bravo :D

oliveagle

QQ: 54679821

微博: @奔跑在高架上
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Saturday, June 1, 2013 at 1:09 AM, Aaron Meurer wrote:

I added an item to the FAQ about where breakpoints are stored in #74 (#74). See what you think.


Reply to this email directly or view it on GitHub (#73 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants