From e943b0605ff7000280bcf190f35f9097a6ae5f67 Mon Sep 17 00:00:00 2001 From: Randy Ramos Date: Wed, 6 Sep 2017 17:17:40 -0400 Subject: URL encode href before saving to sync.db When pushing objects, the unencoded uri path would be saved into the sync.db. The unencoded path and the encoded path from the server would be seen as two different objects, causing both to be resynced unnecessarily. Signed-off-by: Randy Ramos Signed-off-by: Lukas Fleischer --- contrib/caldav/calcurse-caldav.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index 1db4740..84e2638 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -10,6 +10,7 @@ import ssl import subprocess import sys import textwrap +import urllib.parse import xml.etree.ElementTree as etree @@ -242,7 +243,7 @@ def push_object(conn, objhash): etag = next(iter(etagdict.values())) etag = etag.strip('"') - return (href, etag) + return (urllib.parse.quote(href), etag) def push_objects(objhashes, conn, syncdb, etagdict): -- cgit v1.2.3-54-g00ecf