From: W. Trevor King <wking@tremily.us> Date: Sun, 30 Jun 2013 16:09:04 +0000 (-0400) Subject: aggregator: Escape VERSION and PRODID X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=029d45d0e31de4fa5f4adeafd07b6a1ee27afb21;p=pycalendar.git aggregator: Escape VERSION and PRODID From RFC 5545, sections 3.7.3 (Product Identifier) and 3.7.4 (Version), these are both text fields. --- 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)