diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-11 13:05:32 +0100 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-11 13:05:32 +0100 |
| commit | f0a3905357e596c9a2a85358fda0f41384ff3d39 (patch) | |
| tree | e505a8f0c09672f73a1c0bdf783433fe70b9312b /pkg_resources.py | |
| parent | 7adfcead12a21b2ed6b13f5a75477914b524cb12 (diff) | |
| download | python-setuptools-git-f0a3905357e596c9a2a85358fda0f41384ff3d39.tar.gz | |
Fix for yet unpublished issue to ensure that get_resource_filename always re-extracts the content of a temporary filename if it does not match that of the source content.
--HG--
branch : distribute
extra : rebase_source : 5605ee258010cde1237db058b770c62264c215e2
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index b59f1703..2ec645d3 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1459,7 +1459,14 @@ class ZipProvider(EggProvider): if not os.path.isfile(file_path): return False stat = os.stat(file_path) - return stat.st_size==size and stat.st_mtime==timestamp + if stat.st_size!=size or stat.st_mtime!=timestamp: + return False + # check that the contents match + zip_contents = self.loader.get_data(zip_path) + f = open(file_path, 'rb') + file_contents = f.read() + f.close() + return zip_contents == file_contents def _get_eager_resources(self): if self.eagers is None: |
