mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Fix status migration on Py34
This commit is contained in:
parent
9a32c34e76
commit
e7a746705f
1 changed files with 3 additions and 1 deletions
|
|
@ -209,10 +209,12 @@ def manage_sync_status(base_path, pair_name, collection_name):
|
||||||
status = None
|
status = None
|
||||||
legacy_status = None
|
legacy_status = None
|
||||||
try:
|
try:
|
||||||
|
# XXX: Legacy migration
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
if f.read(1) == b'{':
|
if f.read(1) == b'{':
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
legacy_status = dict(json.load(f))
|
# json.load doesn't work on binary files for Python 3.4/3.5
|
||||||
|
legacy_status = dict(json.loads(f.read().decode('utf-8')))
|
||||||
except (OSError, IOError, ValueError):
|
except (OSError, IOError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue