Exception running pudb to debug within IPython 5.10
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 245
- Avg merge
- 13m
- Merged PRs (30d)
- 5
Description
I'm trying to use pudb to debug code from within IPython. This used to work wonderfully, but seems to be broken now unfortunately.
Sample (interactive) snippet to induce the problem
```
In [1]: import pudb.ipython
In [2]: def woo(a):
...: b = 2 / a
...: print('hi')
...:
In [3]: woo(0)
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
in ()
----> 1 woo(0)
in woo(a)
1 def woo(a):
----> 2 b = 2 / a
3 print('hi')
4
ZeroDivisionError: division by zero
In [4]: %debug
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 get_ipython().magic('debug')
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2156 magic_name, _, magic_arg_s = arg_s.partition(' ')
2157 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158 return self.run_line_magic(magic_name, magic_arg_s)
2159
2160 #-------------------------------------------------------------------------
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2077 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078 with self.builtin_trap:
-> 2079 result = fn(*args,**kwargs)
2080 return result
2081
in debug(self, line, cell)
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/IPython/core/magic.py in (f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/IPython/core/magics/execution.py in debug(self, line, cell)
426
427 if not (args.breakpoint or args.statement or cell):
--> 428 self._debug_post_mortem()
429 else:
430 code = "\n".join(args.statement)
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/IPython/core/magics/execution.py in _debug_post_mortem(self)
434
435 def _debug_post_mortem(self):
--> 436 self.shell.debugger(force=True)
437
438 def _debug_exec(self, code, breakpoint):
/Users/Andrew/anaconda/envs/dev/lib/python3.5/site-packages/pudb/ipython.py in debugger(self, force)
123 from pudb import pm
124
--> 125 with self.readline_no_record:
126 pm()
127
AttributeError: 'TerminalInteractiveShell' object has no attribute 'readline_no_record'
```
Pudb works fine if I invoke it directly from the command line, e.g.
```
pudb3 woo.py
```
And, from pudb, I can use IPython interactively after pressing `i`.
(This may also be a problem with earlier versions of IPython 5.)
Using pudb 2016.2 via pip.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.