From c5729523ee2db66d76b81d53a97df3bf08cfb778 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Thu, 21 Mar 2019 01:16:42 -0400 Subject: [PATCH] Update vistir to rely on new rmtree logic Signed-off-by: Dan Ryan --- pipenv/patched/notpip/_internal/utils/temp_dir.py | 1 + pipenv/vendor/vistir/compat.py | 4 +--- tasks/vendoring/patches/patched/pip19.patch | 10 ++++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pipenv/patched/notpip/_internal/utils/temp_dir.py b/pipenv/patched/notpip/_internal/utils/temp_dir.py index d8911bc9..d8121a59 100644 --- a/pipenv/patched/notpip/_internal/utils/temp_dir.py +++ b/pipenv/patched/notpip/_internal/utils/temp_dir.py @@ -184,4 +184,5 @@ class AdjacentTempDirectory(TempDirectory): self.path = os.path.realpath( tempfile.mkdtemp(prefix="pip-{}-".format(self.kind)) ) + self._register_finalizer() logger.debug("Created temporary directory: {}".format(self.path)) diff --git a/pipenv/vendor/vistir/compat.py b/pipenv/vendor/vistir/compat.py index e8688d89..d3f42e46 100644 --- a/pipenv/vendor/vistir/compat.py +++ b/pipenv/vendor/vistir/compat.py @@ -186,13 +186,11 @@ class TemporaryDirectory(object): os.unlink(path) # PermissionError is raised on FreeBSD for directories except (IsADirectoryError, PermissionError, OSError): - cls._rmtree(path) + rmtree(path) except FileNotFoundError: pass elif issubclass(exc_info[0], FileNotFoundError): pass - else: - raise rmtree(name, onerror=onerror) diff --git a/tasks/vendoring/patches/patched/pip19.patch b/tasks/vendoring/patches/patched/pip19.patch index 1c10d5c5..7dd912dc 100644 --- a/tasks/vendoring/patches/patched/pip19.patch +++ b/tasks/vendoring/patches/patched/pip19.patch @@ -289,7 +289,7 @@ index d1410e93..69a53bf2 100644 def cleanup_files(self): # type: () -> None diff --git a/pipenv/patched/notpip/_internal/resolve.py b/pipenv/patched/notpip/_internal/resolve.py -index 33f572f1..aa827193 100644 +index 33f572f1..dfe149ad 100644 --- a/pipenv/patched/notpip/_internal/resolve.py +++ b/pipenv/patched/notpip/_internal/resolve.py @@ -19,6 +19,7 @@ from pip._internal.exceptions import ( @@ -416,7 +416,7 @@ index 7aaf7b5e..d56f0512 100644 if not check_requires_python(requires_python): raise exceptions.UnsupportedPythonVersion( diff --git a/pipenv/patched/notpip/_internal/utils/temp_dir.py b/pipenv/patched/notpip/_internal/utils/temp_dir.py -index 2c81ad55..fbf0292a 100644 +index 2c81ad55..ff2ccc5a 100644 --- a/pipenv/patched/notpip/_internal/utils/temp_dir.py +++ b/pipenv/patched/notpip/_internal/utils/temp_dir.py @@ -5,8 +5,10 @@ import itertools @@ -485,6 +485,12 @@ index 2c81ad55..fbf0292a 100644 class AdjacentTempDirectory(TempDirectory): +@@ -152,4 +184,5 @@ class AdjacentTempDirectory(TempDirectory): + self.path = os.path.realpath( + tempfile.mkdtemp(prefix="pip-{}-".format(self.kind)) + ) ++ self._register_finalizer() + logger.debug("Created temporary directory: {}".format(self.path)) diff --git a/pipenv/patched/notpip/_internal/wheel.py b/pipenv/patched/notpip/_internal/wheel.py index 67bcc7f7..968cdff9 100644 --- a/pipenv/patched/notpip/_internal/wheel.py