Commit f0a39053 authored by Jason R. Coombs's avatar Jason R. Coombs

Fix for yet unpublished issue to ensure that get_resource_filename always...

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
parent 7adfcead
......@@ -3,6 +3,13 @@ CHANGES
=======
------
0.6.39
------
* Issue ####: Resources extracted from a zip egg to the file system now also
check the contents of the file against the zip contents during each
invocation of get_resource_filename.
0.6.38
------
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment