ipython: Tab completions for paths broken again in 7.2.0

Tab completion for paths within strings seems to be broken again (previously noted many places, like #10961, #10996, notebook issue #3333). Here’s what I get in v7.2.0:

screen shot 2018-12-14 at 12 39 17 pm

Compared to the behavior in v7.1.1:

screen shot 2018-12-14 at 12 38 20 pm

Probably related to #11503, as disabling Jedi (setting c.IPCompleter.use_jedi = False in ipython_config.py) gives the correct behavior.

System info
{'commit_hash': '523ed2fe5',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python3.6/site-packages/IPython',
 'ipython_version': '7.2.0',
 'os_name': 'posix',
 'platform': 'Darwin-17.7.0-x86_64-i386-64bit',
 'sys_executable': '/usr/local/opt/python/bin/python3.6',
 'sys_platform': 'darwin',
 'sys_version': '3.6.5 (default, Jun 17 2018, 12:13:06) \n'
                '[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]'}

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 44
  • Comments: 34 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Downgrading to ipython==7.1.1 seemed to work as a fix for me.

For those who have run into issues with downgrading, I found @ivirshup’s comment to be most helpful - to disable jedi autocomplete in the ipython config. If you haven’t already, you can generate an ipython_config.py with:

# Generate config
ipython profile create
# Edit config file in vim
vim .ipython/profile_default/ipython_kernel_config.py 

And change c.IPCompleter.use_jedi = False in ipython_config.py

Just look at the use case in the image: Why would I want to type a Python object name inside of a string literal?

Updating IPython - 7.20.0, resolved for me. Regards

@flying-sheep @augustogoulart Are you open to pull requests on this? (I mean, the “helpwanted” tag suggests so, but I’m not an existing contributor so not sure of the developer norms here.) I have some minor changes to the logic in the detection of whether we are in a string or not, which, while not a perfect fix, at least does a better job of turning off jedi.

This doesn’t completely fix #10926 or this, since it would be nice to turn off (in my opinion):

  • file completion matches when in a dictionary key string
  • magic completion matches when in any string

but it does at least turn off jedi when in a string, which goes a long way in making my own use patterns workable.

I upgraded to the latest version of ipython as of today (7.11.0), and the problem still persists.

@meeseeksdev tag help wanted