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

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 4 10:57:54 PDT 2015


Revision: 14871
          http://trac.calendarserver.org//changeset/14871
Author:   cdaboo at apple.com
Date:     2015-06-04 10:57:54 -0700 (Thu, 04 Jun 2015)
Log Message:
-----------
Fix non-ascii ServerRoot path issues.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/accounting.py
    CalendarServer/trunk/twistedcaldav/timezones.py

Modified: CalendarServer/trunk/twistedcaldav/accounting.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/accounting.py	2015-06-04 17:47:10 UTC (rev 14870)
+++ CalendarServer/trunk/twistedcaldav/accounting.py	2015-06-04 17:57:54 UTC (rev 14871)
@@ -83,10 +83,11 @@
     if isinstance(record, str):
         principalLogPath = record
     elif accountingEnabled(category, record):
+        ruid = record.uid.encode("utf-8")
         principalLogPath = os.path.join(
-            record.uid[0:2],
-            record.uid[2:4],
-            record.uid
+            ruid[0:2],
+            ruid[2:4],
+            ruid
         )
     else:
         return None

Modified: CalendarServer/trunk/twistedcaldav/timezones.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/timezones.py	2015-06-04 17:47:10 UTC (rev 14870)
+++ CalendarServer/trunk/twistedcaldav/timezones.py	2015-06-04 17:57:54 UTC (rev 14871)
@@ -186,6 +186,8 @@
     cannot be found.
     """
 
+    if isinstance(tzid, unicode):
+        tzid = tzid.encode("utf-8")
     if tzid not in cachedVTZs:
         readVTZ(tzid)
     return True
@@ -196,6 +198,8 @@
     """
     Add a VTIMEZONE component to the cache.
     """
+    if isinstance(tzid, unicode):
+        tzid = tzid.encode("utf-8")
     if tzid not in cachedVTZs:
         cachedVTZs[tzid] = tzcal
         cachedTZs[tzid] = str(tzcal)
@@ -207,6 +211,8 @@
     Try to load the specified TZID as a calendar object from the database. Raise if not found.
     """
 
+    if isinstance(tzid, unicode):
+        tzid = tzid.encode("utf-8")
     if tzid not in cachedVTZs:
 
         tzcal = TimezoneDatabase.getTimezoneInCalendar(tzid)
@@ -224,6 +230,8 @@
     Try to load the specified TZID as text from the database. Raise if not found.
     """
 
+    if isinstance(tzid, unicode):
+        tzid = tzid.encode("utf-8")
     if tzid not in cachedTZs:
 
         tzcal = readVTZ(tzid)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150604/8070c726/attachment-0001.html>


More information about the calendarserver-changes mailing list