mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +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
|
||||
legacy_status = None
|
||||
try:
|
||||
# XXX: Legacy migration
|
||||
with open(path, 'rb') as f:
|
||||
if f.read(1) == b'{':
|
||||
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):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue