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

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 27 16:07:12 PDT 2011


Revision: 7681
          http://trac.macosforge.org/projects/calendarserver/changeset/7681
Author:   sagen at apple.com
Date:     2011-06-27 16:07:12 -0700 (Mon, 27 Jun 2011)
Log Message:
-----------
Fix for non-ascii names in imip

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/mail.py
    CalendarServer/trunk/twistedcaldav/test/test_mail.py

Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py	2011-06-27 22:59:53 UTC (rev 7680)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2011-06-27 23:07:12 UTC (rev 7681)
@@ -537,8 +537,9 @@
         it happens after we've shed privileges
         """
         service.MultiService.startService(self)
-        if self.mailer is not None:
-            self.mailer.purge()
+        mailer = getattr(self, "mailer", None)
+        if mailer is not None:
+            mailer.purge()
 
 
 class MailGatewayServiceMaker(LoggingMixIn):
@@ -853,7 +854,7 @@
         for attendeeProp in calendar.getAllAttendeeProperties():
             cutype = attendeeProp.parameterValue('CUTYPE', None)
             if cutype == "INDIVIDUAL":
-                cn = attendeeProp.parameterValue("CN", None)
+                cn = attendeeProp.parameterValue("CN", None).decode("utf-8")
                 cuaddr = normalizeCUAddr(attendeeProp.value())
                 if cuaddr.startswith("mailto:"):
                     mailto = cuaddr[7:]

Modified: CalendarServer/trunk/twistedcaldav/test/test_mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-06-27 22:59:53 UTC (rev 7680)
+++ CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-06-27 23:07:12 UTC (rev 7681)
@@ -243,14 +243,14 @@
         data = (
             # Initial invite
             (
-                """BEGIN:VCALENDAR
+                u"""BEGIN:VCALENDAR
 VERSION:2.0
 METHOD:REQUEST
 BEGIN:VEVENT
 UID:CFDD5E46-4F74-478A-9311-B3FF905449C3
 DTSTART:20100325T154500Z
 DTEND:20100325T164500Z
-ATTENDEE;CN=The Attendee;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:attendee at example.com
+ATTENDEE;CN=Th\xe9 Attendee;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:attendee at example.com
 ATTENDEE;CN=The Organizer;CUTYPE=INDIVIDUAL;EMAIL=organizer at example.com;PARTSTAT=ACCEPTED:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
 ORGANIZER;CN=The Organizer;EMAIL=organizer at example.com:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
 SUMMARY:testing outbound( )
@@ -264,7 +264,7 @@
                 "organizer at example.com",
                 "The Organizer",
                 [
-                    (u'The Attendee', u'attendee at example.com'),
+                    (u'Th\xe9 Attendee', u'attendee at example.com'),
                     (u'The Organizer', u'organizer at example.com')
                 ],
                 "The Organizer <organizer at example.com>",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110627/c2a6e64d/attachment.html>


More information about the calendarserver-changes mailing list