fix cache fs backend(py3)
This commit is contained in:
parent
3e9a7c2e5f
commit
9893e5865d
1 changed files with 2 additions and 2 deletions
|
@ -363,11 +363,11 @@ class FileCache(Cache):
|
||||||
if not info['only_headers']:
|
if not info['only_headers']:
|
||||||
if info['compressed']:
|
if info['compressed']:
|
||||||
data = zlib.compress(data)
|
data = zlib.compress(data)
|
||||||
elif not isinstance(data, str):
|
elif not isinstance(data, bytes):
|
||||||
data = data.encode('utf-8')
|
data = data.encode('utf-8')
|
||||||
with open(f, 'wb') as _f:
|
with open(f, 'wb') as _f:
|
||||||
_f.write(data)
|
_f.write(data)
|
||||||
with open(i, 'wb') as _i:
|
with open(i, 'w') as _i:
|
||||||
json.dump(info, _i)
|
json.dump(info, _i)
|
||||||
|
|
||||||
if cache_path().startswith('fs:'):
|
if cache_path().startswith('fs:'):
|
||||||
|
|
Loading…
Reference in a new issue