Fix #51: Merge pull request #55 from PabloCastellano/use_sha256_for_cache

Changed sha512 to sha256 to avoid "file name too long" error (issue #51)
This commit is contained in:
Oliver Smith 2017-06-04 21:36:20 +00:00 committed by GitHub
commit 8b3ffc8dc8
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ def download(args, url, prefix, cache=True):
# Check if file exists in cache
prefix = prefix.replace("/", "_")
path = (args.work + "/cache_http/" + prefix + "_" +
hashlib.sha512(url.encode("utf-8")).hexdigest())
hashlib.sha256(url.encode("utf-8")).hexdigest())
if os.path.exists(path):
if cache:
return path