fix cache fs backend(py3)

This commit is contained in:
j 2016-09-07 15:47:12 +02:00
parent 3e9a7c2e5f
commit 9893e5865d

View file

@ -363,11 +363,11 @@ class FileCache(Cache):
if not info['only_headers']:
if info['compressed']:
data = zlib.compress(data)
elif not isinstance(data, str):
elif not isinstance(data, bytes):
data = data.encode('utf-8')
with open(f, 'wb') as _f:
_f.write(data)
with open(i, 'wb') as _i:
with open(i, 'w') as _i:
json.dump(info, _i)
if cache_path().startswith('fs:'):