ipython: Tab-completion raises exception
Not sure whether this is an issue with IPython 5.0.0 or pyramid_ipython 0.1, but tab-completion raises an exception when trying to tab-complete the transaction module.
- pip install -U ipython pyramid_ipython transaction
- pshell development.ini
- import tran<TAB>
In [5]: import tranException in thread Thread-127:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 766, in run
self.__target(_self.__args, *_self.__kwargs)
File "/usr/lib/python2.7/site-packages/prompt_toolkit/interface.py", line 835, in run
completions = list(buffer.completer.get_completions(document, complete_event))
File "/usr/lib/python2.7/site-packages/IPython/terminal/ptutils.py", line 24, in get_completions
cursor_pos=document.cursor_position_col
File "/usr/lib/python2.7/site-packages/IPython/core/completer.py", line 84, in comp
text, matches = complete(_args, *_kwargs)
File "/usr/lib/python2.7/site-packages/IPython/core/completer.py", line 1186, in complete
custom_res = self.dispatch_custom_completer(text)
File "/usr/lib/python2.7/site-packages/IPython/core/completer.py", line 1110, in dispatch_custom_completer
res = c(event)
File "/usr/lib/python2.7/site-packages/IPython/core/completerlib.py", line 253, in module_completer
return module_completion(event.line)
File "/usr/lib/python2.7/site-packages/IPython/core/completerlib.py", line 229, in module_completion
return get_root_modules()
File "/usr/lib/python2.7/site-packages/IPython/core/completerlib.py", line 119, in get_root_modules
rootmodules_cache = ip.db.get('rootmodules_cache', {})
AttributeError: 'NoneType' object has no attribute 'db'
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 3
- Comments: 18 (8 by maintainers)
Commits related to this issue
- work around https://github.com/ipython/ipython/issues/9798 — committed to Pylons/pyramid_ipython by mmerickel 10 years ago
- Closes #1012: Fixed IPython 5.x shell support * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython/issues/... — committed to frol/werkzeug by frol 10 years ago
- Closes #1012: Fixed IPython 5.x shell support * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython/issues/... — committed to frol/werkzeug by frol 10 years ago
- Closes #1012: Fixed IPython 5.x shell support * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython/issues/9... — committed to frol/werkzeug by frol 10 years ago
- Closes #1012: Fixed IPython 5.x shell support (#1033) * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython... — committed to pallets/werkzeug by frol 10 years ago
- Closes #1012: Fixed IPython 5.x shell support (#1033) * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython... — committed to drewja/werkzeug by frol 10 years ago
- Skip scanning for module names with no global shell instance Closes gh-9798 — committed to takluyver/ipython by takluyver 10 years ago
- Backport PR #10155: Skip scanning for module names with no global shell instance Closes gh-9798 — committed to ipython/ipython by Carreau 10 years ago
- Closes #1012: Fixed IPython 5.x shell support (#1033) * `global_ns` was deprecated in IPython 4.x, and was removed in IPython 5.x. * According to the discussion in https://github.com/ipython/ipython/... — committed to valerysh-mindojo/werkzeug by frol 10 years ago
Using
.instance()creates an instance and sets it as the global shell instance, which the completion machinery uses. Instantiating it directly does not register it as a global shell instance.Discovered in my code that
This code snippet fails.
This code snippet works.
There is something being done differently with the instance method call.
@takluyver we’re hitting this as well (on 5.1), and are unable to switch to
embedorstart_ipythonsince we’re usingset_custom_excto handle specific exceptions during the input loop.Any ideas about a possible workaround?