From 969ebb653d70d3f8d71fbbb3a4461a64b0de7714 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Thu, 1 May 2014 11:07:09 +0200 Subject: [PATCH] Fix bug with multiline values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The URL that showed this error up was https://mozorg.cdn.mozilla.net/media/caldata/GermanHolidays.ics with the following entry: BEGIN:VEVENT CREATED:20061023T132503Z LAST-MODIFIED:20101214T141313Z DTSTAMP:20101214T141313Z UID:917544590 SUMMARY:Heilige drei Könige STATUS:CONFIRMED RRULE:FREQ=YEARLY;BYMONTH=1 CATEGORIES:Feiertag DTSTART;VALUE=DATE:20060106 DTEND;VALUE=DATE:20060107 DESCRIPTION:Christlicher Feiertag. Nur in Baden-Württemberg\, Bayern und Sachsen-Anhalt. X-MOZ-GENERATION:1 END:VEVENT --- tests/storage/test_http.py | 1 + vdirsyncer/storage/http.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/storage/test_http.py b/tests/storage/test_http.py index 510582f..82cd09f 100644 --- a/tests/storage/test_http.py +++ b/tests/storage/test_http.py @@ -24,6 +24,7 @@ class TestHttpStorage(object): (u'BEGIN:VEVENT\n' u'SUMMARY:Eine zweite Kurzinfo\n' u'DESCRIPTION:Beschreibung des anderen Termines\n' + u' With an extra line for description\n' u'BEGIN:VALARM\n' u'ACTION:AUDIO\n' u'TRIGGER:19980403T120000\n' diff --git a/vdirsyncer/storage/http.py b/vdirsyncer/storage/http.py index e7d8eea..e76b104 100644 --- a/vdirsyncer/storage/http.py +++ b/vdirsyncer/storage/http.py @@ -20,7 +20,8 @@ def split_collection(text): collection_type = None item_type = None for line in text.splitlines(): - if not line.strip(): + if u':' not in line: + item.append(line) continue key, value = (x.strip() for x in line.split(u':', 1)) if key == u'BEGIN':