From f20ea35fd76591bd9d1310edce943e59d062b147 2017-09-25 20:09:00 From: Matthias Bussonnier Date: 2017-09-25 20:09:00 Subject: [PATCH] Check from venv path length before doing path manipulation. Closes #10823 --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 1d537e8..6052508 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -718,7 +718,7 @@ class InteractiveShell(SingletonConfigurable): # In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible if p_venv.startswith('\\cygdrive'): p_venv = p_venv[11:] - elif p_venv[1] == ':': + elif len(p_venv) >= 2 and p_venv[1] == ':': p_venv = p_venv[2:] if any(p_venv in p for p in paths):