From 545a23662cad1b3d4e7351854093027b0619c8d0 Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Fri, 2 Nov 2018 20:40:04 +0300 Subject: [PATCH] Fix _get_virtualenv_hash function Case-sensitive filesystems were handled like case-insensitive and vice versa. Close #3151 This changes also: - Add PyCharm's config directory to .gitignore --- .gitignore | 3 +++ news/3151.bugfix | 1 + pipenv/project.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 news/3151.bugfix diff --git a/.gitignore b/.gitignore index 4809d06543..766ffe3a68 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ .AppleDouble .LSOverride +# PyCharm +.idea/ + # VSCode .vscode diff --git a/news/3151.bugfix b/news/3151.bugfix new file mode 100644 index 0000000000..96f14c10f9 --- /dev/null +++ b/news/3151.bugfix @@ -0,0 +1 @@ +Fix project path hashing logic in purpose to prevent collisions of virtual environments. diff --git a/pipenv/project.py b/pipenv/project.py index 195448d93f..0b32811d92 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -449,7 +449,7 @@ def get_name(name, location): # In-project venv # "Proper" path casing (on non-case-sensitive filesystems). if ( - fnmatch.fnmatch("A", "a") + not fnmatch.fnmatch("A", "a") or self.is_venv_in_project() or get_workon_home().joinpath(venv_name).exists() ):