diff --git a/CHANGES.md b/CHANGES.md index 8a00eaf1..5caf1dfd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -59,6 +59,7 @@ * Update ConfigObj library 4.6.0 to 5.1.0 (a68530a) * Update Beautiful Soup to 4.3.2 (r353) * Update jsonrpclib library r20 to (b59217c) +* Change cachecontrol library to ensure cache file exists before attempting delete [develop changelog] * Update Requests library 2.7.0 (ab1f493) to 2.7.0 (8b5e457) diff --git a/HACKS.txt b/HACKS.txt index cbae91d6..3e2e9fe6 100644 --- a/HACKS.txt +++ b/HACKS.txt @@ -3,3 +3,4 @@ Libs with customisations... /tornado /lib/requests/packages/urllib3/connectionpool.py /lib/requests/packages/urllib3/util/ssl_.py +/lib/cachecontrol/caches/file_cache.py diff --git a/lib/cachecontrol/caches/file_cache.py b/lib/cachecontrol/caches/file_cache.py index fd12c8a9..79b59091 100644 --- a/lib/cachecontrol/caches/file_cache.py +++ b/lib/cachecontrol/caches/file_cache.py @@ -90,7 +90,7 @@ class FileCache(BaseCache): def delete(self, key): name = self._fn(key) - if not self.forever: + if not self.forever and os.path.exists(name): os.remove(name)