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

pdbpp + IPython 7.16 is broken #408

Closed
shwina opened this issue Jul 30, 2020 · 4 comments
Closed

pdbpp + IPython 7.16 is broken #408

shwina opened this issue Jul 30, 2020 · 4 comments
Labels

Comments

@shwina
Copy link
Contributor

shwina commented Jul 30, 2020

Greetings!

pdbpp (latest) doesn't work with IPython (7.16.1). Attempting to use pdb commands such as u yields the following behaviour:

ipdb++> u
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<string> in <module>

~/miniconda3/envs/cudf_dev/lib/python3.7/bdb.py in trace_dispatch(self, frame, event, arg)
     86             return # None
     87         if event == 'line':
---> 88             return self.dispatch_line(frame)
     89         if event == 'call':
     90             return self.dispatch_call(frame, arg)

~/miniconda3/envs/cudf_dev/lib/python3.7/bdb.py in dispatch_line(self, frame)
    110         """
    111         if self.stop_here(frame) or self.break_here(frame):
--> 112             self.user_line(frame)
    113             if self.quitting: raise BdbQuit
    114         return self.trace_dispatch

~/miniconda3/envs/cudf_dev/lib/python3.7/pdb.py in user_line(self, frame)
    257             self._wait_for_mainpyfile = False
    258         if self.bp_commands(frame):
--> 259             self.interaction(frame, None)
    260
    261     def bp_commands(self, frame):

~/miniconda3/envs/cudf_dev/lib/python3.7/site-packages/IPython/core/debugger.py in interaction(self, frame, traceback)
    303     def interaction(self, frame, traceback):
    304         try:
--> 305             OldPdb.interaction(self, frame, traceback)
    306         except KeyboardInterrupt:
    307             self.stdout.write("\n" + self.shell.get_exception_only())

~/miniconda3/envs/cudf_dev/lib/python3.7/site-packages/pdbpp.py in interaction(self, frame, traceback)
    450         self._in_interaction = True
    451         try:
--> 452             return self._interaction(frame, traceback)
    453         finally:
    454             self._in_interaction = False

~/miniconda3/envs/cudf_dev/lib/python3.7/site-packages/pdbpp.py in _interaction(self, frame, traceback)
    486             # Use _cmdloop on py3 which catches KeyboardInterrupt.
    487             if hasattr(self, '_cmdloop'):
--> 488                 self._cmdloop()
    489             else:
    490                 self.cmdloop()

~/miniconda3/envs/cudf_dev/lib/python3.7/pdb.py in _cmdloop(self)
    317                 # the current command, so allow them during interactive input
    318                 self.allow_kbdint = True
--> 319                 self.cmdloop()
    320                 self.allow_kbdint = False
    321                 break

~/miniconda3/envs/cudf_dev/lib/python3.7/site-packages/IPython/terminal/debugger.py in cmdloop(self, intro)
    124
    125                 line = self.precmd(line)
--> 126                 stop = self.onecmd(line)
    127                 stop = self.postcmd(stop, line)
    128             self.postloop()

~/miniconda3/envs/cudf_dev/lib/python3.7/pdb.py in onecmd(self, line)
    414         """
    415         if not self.commands_defining:
--> 416             return cmd.Cmd.onecmd(self, line)
    417         else:
    418             return self.handle_command_def(line)

~/miniconda3/envs/cudf_dev/lib/python3.7/cmd.py in onecmd(self, line)
    215             except AttributeError:
    216                 return self.default(line)
--> 217             return func(arg)
    218
    219     def emptyline(self):

~/miniconda3/envs/cudf_dev/lib/python3.7/site-packages/IPython/core/debugger.py in do_up(self, arg)
    698             _newindex = self.curindex
    699             counter = 0
--> 700             hidden_frames = self.hidden_frames(self.stack)
    701             for i in range(self.curindex - 1, -1, -1):
    702                 frame = self.stack[i][0]

TypeError: 'list' object is not callable

It looks like this is due to a discrepancy between the hidden_frames attribute of pdbpp.Pdb, and the hidden_frames method of IPython.core.debugger.Pdb.

Note that the latter was introduced recently, which may explain why this behaviour is new.

@blueyed blueyed added the bug label Aug 28, 2020
@minusf
Copy link

minusf commented Sep 29, 2020

i can confirm pdbpp (0.10.2) not working if ipython (7.18.1) is installed. the pdbpp prompt doesn't show at all and the process needs to be killed.

@shwina
Copy link
Contributor Author

shwina commented Nov 22, 2020

Can confirm this is fIxed in #426

@mdengler
Copy link

Thanks for pdbpp. I'd like to use it, but I use iPython, too. Is there a release scheduled to get this fix out to pypi?

@blueyed
Copy link
Collaborator

blueyed commented May 12, 2021

@mdengler
A bugfix release is being worked on / prepared in #447.

Apart from that I recommend installing it from master currently: pip install git+https://github.com/pdbpp/pdbpp@master
There are many improvements (and (other) fixes) there, and it is mainly blocked by #260, which might take longer to solve.

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

No branches or pull requests

4 participants