Use ast parser to parse ETag, also in db.py.
This commit is contained in:
parent
15f478ee78
commit
67d14bb7fb
|
@ -31,6 +31,7 @@ import glob
|
||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
from jsmin import jsmin
|
from jsmin import jsmin
|
||||||
|
import ast
|
||||||
|
|
||||||
|
|
||||||
def get_etag(ext_id, datepath, con):
|
def get_etag(ext_id, datepath, con):
|
||||||
|
@ -48,7 +49,7 @@ def get_etag(ext_id, datepath, con):
|
||||||
with open(headerpath) as f:
|
with open(headerpath) as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
try:
|
try:
|
||||||
headers = eval(content)
|
headers = ast.literal_eval(content)
|
||||||
if "ETag" in headers:
|
if "ETag" in headers:
|
||||||
return headers["ETag"]
|
return headers["ETag"]
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in New Issue