Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e2c48a

Browse files
authored
Merge pull request #13094 from MRCWirtz/master
Fix virtual environment user warning for lower case pathes
2 parents e768061 + d17b81e commit 3e2c48a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,11 @@ def init_virtualenv(self):
928928
elif len(str(p_venv)) >= 2 and str(p_venv)[1] == ":":
929929
p_venv = Path(str(p_venv)[2:])
930930

931+
if sys.platform == "win32":
932+
# On Windows there might be a mixture of lower-case and mixed-case paths
933+
p_venv = Path(str(p_venv).lower())
934+
paths = [Path(str(p).lower()) for p in paths]
935+
931936
if any(os.fspath(p_venv) in os.fspath(p) for p in paths):
932937
# Our exe is inside or has access to the virtualenv, don't need to do anything.
933938
return

0 commit comments

Comments
 (0)