From 029d45d0e31de4fa5f4adeafd07b6a1ee27afb21 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 30 Jun 2013 12:09:04 -0400 Subject: [PATCH] aggregator: Escape VERSION and PRODID From RFC 5545, sections 3.7.3 (Product Identifier) and 3.7.4 (Version), these are both text fields. --- pycalendar/aggregator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pycalendar/aggregator.py b/pycalendar/aggregator.py index 6b611b9..8df064b 100644 --- a/pycalendar/aggregator.py +++ b/pycalendar/aggregator.py @@ -1,5 +1,8 @@ # Copyright +from . import text as _text + + class Aggregator (list): r"""An iCalendar feed aggregator @@ -74,8 +77,8 @@ class Aggregator (list): def write(self, stream): stream.write('BEGIN:VCALENDAR\r\n') - stream.write('VERSION:{}\r\n'.format(self.version)) - stream.write('PRODID:{}\r\n'.format(self.prodid)) + stream.write('VERSION:{}\r\n'.format(_text.escape(self.version))) + stream.write('PRODID:{}\r\n'.format(_text.escape(self.prodid))) for feed in self: for entry in feed: entry.write(stream=stream) -- 2.26.2