From e7a746705f42d664549954e402c56c55a14875a2 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Tue, 28 Mar 2017 10:47:09 +0200 Subject: [PATCH] Fix status migration on Py34 --- vdirsyncer/cli/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vdirsyncer/cli/utils.py b/vdirsyncer/cli/utils.py index 6aac374..d53215d 100644 --- a/vdirsyncer/cli/utils.py +++ b/vdirsyncer/cli/utils.py @@ -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