Opened 3 years ago

Closed 3 years ago

#62046 closed defect (fixed)

py38-ipython @7.19.0_0: tab-completion crash

Reported by: khorton (Kevin Horton) Owned by: lpsinger (Leo Singer)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc: stromnov (Andrey Stromnov), jjstickel (Jonathan Stickel)
Port: py-ipython

Description (last modified by mf2k (Frank Schima))

py37-ipython and py38-ipython crash in Big Sur when using tab completion.

To trigger crash, perform the following:

% ipython
import sys
sys.<tab>
sys.argv?

This may be related to https://github.com/ipython/ipython/issues/12121

The work around for the user is to run ipython without jedi, using: ipython --IPCompleter.use_jedi=False

Crash log:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/ptutils.py", line 113, in get_completions
    yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/ptutils.py", line 129, in _get_completions
    for c in completions:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions
    completions = list(completions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/completer.py", line 1818, in completions
    for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/completer.py", line 1861, in _completions
    matched_text, matches, matches_origin, jedi_matches = self._complete(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/completer.py", line 2029, in _complete
    completions = self._jedi_matches(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/core/completer.py", line 1373, in _jedi_matches
    interpreter = jedi.Interpreter(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/jedi/api/__init__.py", line 725, in __init__
    super().__init__(code, environment=environment,
TypeError: __init__() got an unexpected keyword argument 'column'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/bin/ipython", line 5, in <module>
    start_ipython()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/ipapp.py", line 356, in start
    self.shell.mainloop()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 564, in mainloop
    self.interact()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 547, in interact
    code = self.prompt_for_code()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 473, in prompt_for_code
    text = self.pt_app.prompt(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1013, in prompt
    return self.app.run(set_exception_handler=set_exception_handler)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 816, in run
    return loop.run_until_complete(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 783, in run_async
    return await _run_async2()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 771, in _run_async2
    await self.cancel_and_wait_for_background_tasks()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 872, in cancel_and_wait_for_background_tasks
    await task
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/buffer.py", line 1854, in new_coroutine
    await coroutine(*a, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/buffer.py", line 1683, in async_completer
    async for completion in self.completer.get_completions_async(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/completion/base.py", line 269, in get_completions_async
    async for completion in completer.get_completions_async(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prompt_toolkit/completion/base.py", line 196, in get_completions_async
    for item in self.get_completions(document, complete_event):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/IPython/terminal/ptutils.py", line 116, in get_completions
    exc_type, exc_value, exc_tb = sys.exc_info()
NameError: name 'sys' is not defined

If you suspect this is an IPython 7.19.0 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

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

Change History (9)

comment:1 Changed 3 years ago by jjstickel (Jonathan Stickel)

Also occurs on 10.15 and 10.14. Likely related to #61088, triggered by recent updates to py-parso/py-jedi?

comment:2 Changed 3 years ago by mf2k (Frank Schima)

Cc: lpsinger removed
Owner: set to lpsinger
Port: py-ipython added; py38-ipython py37-ipython removed
Status: newassigned

comment:3 Changed 3 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:4 Changed 3 years ago by jjstickel (Jonathan Stickel)

Cc: jjstickel added

comment:6 Changed 3 years ago by jjstickel (Jonathan Stickel)

FWIW, I reverted py-jedi to 0.17.2 via my local ports tree. Now ipython doesn't crash if I attempt tab complete, but tab complete doesn't work either when started as ipython --IPCompleter.use_jedi=True (it does work for ipython --IPCompleter.use_jedi=False). So upstream reports of simply reverting jedi didn't work for me with Macports installed python ecosystem. Not sure why.

comment:7 Changed 3 years ago by jjstickel (Jonathan Stickel)

Upstream patch https://github.com/ipython/ipython/pull/12793 should resolve?

comment:8 Changed 3 years ago by jjstickel (Jonathan Stickel)

Release of ipython-7.20.0 resolves this. I created a PR: https://github.com/macports/macports-ports/pull/9894

comment:9 Changed 3 years ago by jjstickel (Jonathan Stickel)

Resolution: fixed
Status: assignedclosed

In 4478a88a0d336ea95b77b13fe00b8481df51e205/macports-ports (master):

py-ipython: update to version 7.20.0

  • update to version 7.20.0
  • resolves tab-completion issue with py-jedi

Closes: #62046

Note: See TracTickets for help on using tickets.