[CalendarServer-changes] [8739] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 21 12:44:16 PST 2012


Revision: 8739
          http://trac.macosforge.org/projects/calendarserver/changeset/8739
Author:   cdaboo at apple.com
Date:     2012-02-21 12:44:15 -0800 (Tue, 21 Feb 2012)
Log Message:
-----------
HTAB must not be removed during migration.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/test/test_upgrade.py
    CalendarServer/trunk/twistedcaldav/upgrade.py

Modified: CalendarServer/trunk/twistedcaldav/test/test_upgrade.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_upgrade.py	2012-02-21 18:46:04 UTC (rev 8738)
+++ CalendarServer/trunk/twistedcaldav/test/test_upgrade.py	2012-02-21 20:44:15 UTC (rev 8739)
@@ -1423,14 +1423,14 @@
         """
         Control characters aside from NL and CR are removed.
         """
-        data = "Contains\x03 control\x06 characters\x12 some\x0a allowed\x0d"
+        data = "Contains\x03 control\x06 characters\x12 some\x0a\x09allowed\x0d"
         after, changed = removeIllegalCharacters(data)
-        self.assertEquals(after, "Contains control characters some\x0a allowed\x0d")
+        self.assertEquals(after, "Contains control characters some\x0a\x09allowed\x0d")
         self.assertTrue(changed)
 
-        data = "Contains only\x0a legal\x0d"
+        data = "Contains\x09only\x0a legal\x0d"
         after, changed = removeIllegalCharacters(data)
-        self.assertEquals(after, "Contains only\x0a legal\x0d")
+        self.assertEquals(after, "Contains\x09only\x0a legal\x0d")
         self.assertFalse(changed)
 
 

Modified: CalendarServer/trunk/twistedcaldav/upgrade.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/upgrade.py	2012-02-21 18:46:04 UTC (rev 8738)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py	2012-02-21 20:44:15 UTC (rev 8739)
@@ -882,12 +882,12 @@
         os.remove(srcPath)
 
 
-DELETECHARS = ''.join(chr(i) for i in xrange(32) if i not in (10, 13))
+DELETECHARS = ''.join(chr(i) for i in xrange(32) if i not in (9, 10, 13))
 def removeIllegalCharacters(data):
     """
-    Remove all characters below ASCII 32 except NL and CR
+    Remove all characters below ASCII 32 except HTAB, LF and CR
 
-    Return tuple with the processed data, and a boolean indicating wether
+    Return tuple with the processed data, and a boolean indicating whether
     the data changed.
     """
     beforeLen = len(data)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120221/182ea3c0/attachment-0001.html>


More information about the calendarserver-changes mailing list