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

0.18.0 causes ipython to not be able to show command completion. #1722

Closed
kyin98 opened this issue Dec 30, 2020 · 1 comment
Closed

0.18.0 causes ipython to not be able to show command completion. #1722

kyin98 opened this issue Dec 30, 2020 · 1 comment

Comments

@kyin98
Copy link

kyin98 commented Dec 30, 2020

When using jedi 0.18.0, my ipython session will crash when trying to use the 'tab' to command complete:

Traceback (most recent call last):
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 765, in _run_async2
result = await _run_async()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 706, in _run_async
result = await f
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/lab2300-home/kyin/ssim3/.venv/bin/ipython", line 8, in
sys.exit(start_ipython())
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/init.py", line 126, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/traitlets/config/application.py", line 845, in launch_instance
app.start()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 356, in start
self.shell.mainloop()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 564, in mainloop
self.interact()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 547, in interact
code = self.prompt_for_code()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/terminal/interactiveshell.py", line 475, in prompt_for_code
**self._extra_prompt_options())
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1013, in prompt
return self.app.run(set_exception_handler=set_exception_handler)
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 817, in run
self.run_async(pre_run=pre_run, set_exception_handler=set_exception_handler)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 783, in run_async
return await _run_async2()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 771, in _run_async2
await self.cancel_and_wait_for_background_tasks()
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 872, in cancel_and_wait_for_background_tasks
await task
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/buffer.py", line 1854, in new_coroutine
await coroutine(*a, **kw)
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/buffer.py", line 1684, in async_completer
document, complete_event
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/completion/base.py", line 270, in get_completions_async
document, complete_event
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/prompt_toolkit/completion/base.py", line 196, in get_completions_async
for item in self.get_completions(document, complete_event):
File "/lab2300-home/kyin/ssim3/.venv/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 116, in get_completions
print_tb(e)
File "/usr/lib/python3.7/traceback.py", line 53, in print_tb
print_list(extract_tb(tb, limit=limit), file=file)
File "/usr/lib/python3.7/traceback.py", line 72, in extract_tb
return StackSummary.extract(walk_tb(tb), limit=limit)
File "/usr/lib/python3.7/traceback.py", line 344, in extract
for f, lineno in frame_gen:
File "/usr/lib/python3.7/traceback.py", line 309, in walk_tb
yield tb.tb_frame, tb.tb_lineno
AttributeError: 'TypeError' object has no attribute 'tb_frame'

When I change the version back to 0.17.2, the command completion works again. Here are the steps that I used:

  1. virtualenv -p python3 --system-site-packages .venv
  2. create a file requirements.txt with the line "ipython==7.17.0"
  3. activate the virtual environment
  4. run 'pip3 install -r requirements.txt'
  5. run 'ipython'
  6. type 'from sub' and the command completion remain blank
  7. use 'ctrl-d' to exit ipython and the traceback should appear

Work around for me was to add 'jedi==0.17.2' in the requirements file.

@PeterJCLaw
Copy link
Collaborator

Thanks, however this is an issue with IPython (ipython/ipython#12740) and a duplicate of #1714.

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

No branches or pull requests

2 participants