ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
https://ipython.readthedocs.org
BSD 3-Clause "New" or "Revised" License
16.25k stars 4.43k forks source link

Autocomplete of directory sometimes throws an exception and then semi-crashing #10585

Open themuniz opened 7 years ago

themuniz commented 7 years ago

Since upgrading to ipython 6, when I autocomplete for filenames in a directory I will sometimes (about once every 5 times) get an exception (see below) and ipython will semi-crash (the autocomplete and syntax highlighting stop working). While similar to other reported issues, this happens with and without spaces, and only occurs occasionally.

Exiting and restarting ipython fixes the issue.

--System information--

{'commit_hash': '51ce9d73b', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/Users/jmuniz/anaconda/lib/python3.5/site-packages/IPython', 'ipython_version': '6.0.0', 'os_name': 'posix', 'platform': 'Darwin-16.6.0-x86_64-i386-64bit', 'sys_executable': '/Users/jmuniz/anaconda/bin/python', 'sys_platform': 'darwin', 'sys_version': '3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, ' '17:52:12) \n' '[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]'}

--Traceback--

Exception in thread Thread-27 Traceback (most recent call last): File "/Users/jmuniz/anaconda/lib/python3.5/threading.py", line 914, in _bootst self.run() File "/Users/jmuniz/anaconda/lib/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "/Users/jmuniz/anaconda/lib/python3.5/site-packages/prompt_toolkit/interf completions = list(buffer.completer.get_completions(document, complete_event File "/Users/jmuniz/anaconda/lib/python3.5/site-packages/IPython/terminal/ptut yield from self._get_completions(body, offset, cursor_position, self.ipy_com File "/Users/jmuniz/anaconda/lib/python3.5/site-packages/IPython/terminal/ptut yield Completion(c.text, start_position=c.start - offset, display=_elide(dis File "/Users/jmuniz/anaconda/lib/python3.5/site-packages/IPython/terminal/ptut return '{}.{}\N{HORIZONTAL ELLIPSIS}{}.{}'.format(parts[0], parts[1][0], par IndexError: string index out of range

Carreau commented 7 years ago

Oh, I think I fixed this in #10508 would you mind trying master ?

Carreau commented 7 years ago

I'm going t assume #10508 dis actually fix all the things. and close that. Feel free to reopen.

themuniz commented 7 years ago

Sorry for the delay in getting back to you on this, my package manager was a pain.

I'm on 6.1 now, and while the issue happens less frequently, it still occurs. I get the same crash but I also now get the following message before the trackback:

2017-06-21 01:30:28.906 Python[24862:11127349] !!! BUG: The current event queue and the main event queue are not the same. Events will not be handl el

Please consider re-opening.

Carreau commented 7 years ago

Sorry for the delay in getting back to you on this, my package manager was a pain.

I'm on 6.1 now, and while the issue happens less frequently, it still occurs. I get the same crash but I also now get the following message before the trackback:

2017-06-21 01:30:28.906 Python[24862:11127349] !!! BUG: The current event queue and the main event queue are not the same. Events will not be handl el

Are you using open CV ? Because this seem like an openCV thing which is a different bug.