From 7b1c6e0a9d7966522328770cb4ed7464b9c6a5a1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 30 Jun 2013 15:03:03 -0400 Subject: [PATCH] entry: Die unless we're parsing a version 2.0 iCalendar RFC 5545, section 3.7.4 (Version) describes this text field. Until I actually see something using using the (minver ";" maxver) syntax, I'll just require everything to be version 2.0. --- pycalendar/entry.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pycalendar/entry.py b/pycalendar/entry.py index 4e5db9f..46bf3b6 100644 --- a/pycalendar/entry.py +++ b/pycalendar/entry.py @@ -146,6 +146,11 @@ class Entry (dict): self._add_value(key=value, value=child, force_list=True) child_lines = [] elif not stack: # our own data, not a child's + if key == 'VERSION': + v = _text.unescape(value) + if v != '2.0': + raise NotImplementedError( + 'cannot parse VERSION {} feed'.format(v)) self._add_value(key=key, value=value) def _add_value(self, key, value, force_list=False): -- 2.26.2