[icalendar-checkins] r34910 - in iCalendar/trunk: . src/icalendar

regebro at codespeak.net regebro at codespeak.net
Thu Nov 23 17:22:44 CET 2006


Author: regebro
Date: Thu Nov 23 17:22:41 2006
New Revision: 34910

Modified:
   iCalendar/trunk/CHANGES.txt
   iCalendar/trunk/src/icalendar/parser.py
Log:
* The bugfix for the folding of line in the middle of UTF-8 characters included
  another bug, which is now fixed.


Modified: iCalendar/trunk/CHANGES.txt
==============================================================================
--- iCalendar/trunk/CHANGES.txt	(original)
+++ iCalendar/trunk/CHANGES.txt	Thu Nov 23 17:22:41 2006
@@ -1,4 +1,4 @@
 iCalendar 1.2 (unreleased)
 ==========================
 
-No changes yet.
\ No newline at end of file
+* Fixed a string index out of range error in the new folding code.
\ No newline at end of file

Modified: iCalendar/trunk/src/icalendar/parser.py
==============================================================================
--- iCalendar/trunk/src/icalendar/parser.py	(original)
+++ iCalendar/trunk/src/icalendar/parser.py	Thu Nov 23 17:22:41 2006
@@ -261,11 +261,14 @@
     >>> c
     '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 '
 
-    We do not fold withing a UTF-8 character:
+    We do not fold within a UTF-8 character:
     >>> c = Contentline('This line has a UTF-8 character where it should be folded. Make sure it g\xc3\xabts folded before that character.')
     >>> '\xc3\xab' in str(c)
     True
 
+    Don't fail if we fold a line that is exactly X times 74 characters long:
+    >>> c = str(Contentline(''.join(['x']*148)))
+
     It can parse itself into parts. Which is a tuple of (name, params, vals)
 
     >>> c = Contentline('dtstart:20050101T120000')
@@ -426,7 +429,7 @@
         start = 0
         end = 74
         while True:
-            if end > l_line:
+            if end >= l_line:
                 end = l_line
             else:
                 # Check that we don't fold in the middle of a UTF-8 character:


More information about the icalendar-checkins mailing list