Ipython: IPython 5.0.0b2 AssertionError from within prompt_toolkit.buffer

Created on 9 Jun 2016  ·  3Comments  ·  Source: ipython/ipython

Looks like IPython will crash if have fully typed out the word you want, but try to tab-complete anyway and then you press again to unselect the tab-completion dialog.

Example:

  1. type "Import IPython" in IPython
  2. press to enable tab-completion
  3. press again to unselect the tab-completion
  4. press

Here's a console screencast that shows the replication steps for this bug: https://asciinema.org/a/7890yzftp8lzdjzxasrpvdnil

And the stacktrace:

Traceback (most recent call last):
  File "/tmp/foo/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/tmp/foo/lib/python3.5/site-packages/IPython/__init__.py", line 119, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/tmp/foo/lib/python3.5/site-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
  File "/tmp/foo/lib/python3.5/site-packages/IPython/terminal/ipapp.py", line 348, in start
    self.shell.mainloop()
  File "/tmp/foo/lib/python3.5/site-packages/IPython/terminal/ptshell.py", line 398, in mainloop
    self.interact()
  File "/tmp/foo/lib/python3.5/site-packages/IPython/terminal/ptshell.py", line 381, in interact
    code = self.prompt_for_code()
  File "/tmp/foo/lib/python3.5/site-packages/IPython/terminal/ptshell.py", line 324, in prompt_for_code
    pre_run=self.pre_prompt, reset_current_buffer=True)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 387, in run
    self.eventloop.run(self.input, self.create_eventloop_callbacks())
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/eventloop/posix.py", line 154, in run
    t()
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/eventloop/posix.py", line 82, in read_from_stdin
    inputstream.feed(data)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 376, in feed
    self._input_parser.send(c)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 295, in _input_parser_generator
    self._call_handler(match, prefix)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 328, in _call_handler
    self.feed_key_callback(KeyPress(key, insert_text))
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 916, in feed_key
    self._active_cli.input_processor.feed_key(key_press)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 174, in feed_key
    self._process_coroutine.send(key_press)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 146, in _process
    self._call_handler(matches[-1], key_sequence=buffer)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 190, in _call_handler
    handler.call(event)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/key_binding/registry.py", line 32, in call
    return self.handler(event)
  File "/tmp/foo/lib/python3.5/site-packages/IPython/terminal/ptshell.py", line 187, in _
    b.apply_completion(cs.current_completion)
  File "/tmp/foo/lib/python3.5/site-packages/prompt_toolkit/buffer.py", line 762, in apply_completion
    assert isinstance(completion, Completion)
AssertionError

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

Most helpful comment

Ugh, sorry for wasting your time! I dont know how I missed #9578

No problem. You can update, I released the beta3 now, need to announce it.

All 3 comments

duplicate of #9578 , I'll release a beta3 that have the fix in a few minutes.

Ugh, sorry for wasting your time! I dont know how I missed #9578

Ugh, sorry for wasting your time! I dont know how I missed #9578

No problem. You can update, I released the beta3 now, need to announce it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregcaporaso picture gregcaporaso  ·  3Comments

sataliulan picture sataliulan  ·  4Comments

jakirkham picture jakirkham  ·  4Comments

hexhexd picture hexhexd  ·  4Comments

okomarov picture okomarov  ·  3Comments