From 7866b89465dbcf7d62bec85bb70ea0e0c3ca237a 2017-09-29 18:51:55 From: Thomas Kluyver Date: 2017-09-29 18:51:55 Subject: [PATCH] Merge pull request #10829 from Carreau/penv Check from venv path length before doing path manipulation. --- 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):