-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
pdb: "debug print(" crashes with SyntaxError #80112
Comments
% python -c '__import__("pdb").set_trace()'
--Return--
> <string>(1)<module>()->None
(Pdb) print(
*** SyntaxError: unexpected EOF while parsing
(Pdb) debug print(
ENTERING RECURSIVE DEBUGGER
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python3.7/bdb.py", line 92, in trace_dispatch
return self.dispatch_return(frame, arg)
File "/usr/lib64/python3.7/bdb.py", line 151, in dispatch_return
self.user_return(frame, arg)
File "/usr/lib64/python3.7/pdb.py", line 293, in user_return
self.interaction(frame, None)
File "/usr/lib64/python3.7/pdb.py", line 352, in interaction
self._cmdloop()
File "/usr/lib64/python3.7/pdb.py", line 321, in _cmdloop
self.cmdloop()
File "/usr/lib64/python3.7/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib64/python3.7/pdb.py", line 418, in onecmd
return cmd.Cmd.onecmd(self, line)
File "/usr/lib64/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "/usr/lib64/python3.7/pdb.py", line 1099, in do_debug
sys.call_tracing(p.run, (arg, globals, locals))
File "/usr/lib64/python3.7/bdb.py", line 582, in run
cmd = compile(cmd, "<string>", "exec")
File "<string>", line 1
print(
^
SyntaxError: unexpected EOF while parsing |
ping reviewer :-) I test this PR and work fine on Ubuntu 18.04 |
Thanks for the patch! |
Thanks for the review and backport! |
Re-opening: it currently still crashes with a NameError when using "debug doesnotexist", or "debug doesnotexist()". Will create a new PR for this. |
Bumping. The first (merged) patch is not sufficient, and causes even an API breakage, because it disallows passing in a code object (via compile()) anymore. A better fix is waiting at #12103, and should also get backported to for 3.7.3 then (or the first backport being reverted). |
Example of the API breakage:
(via https://travis-ci.org/antocuni/pdb/jobs/504061679#L367) |
Thanks for catching that and fixing it before 3.7.3! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: