apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
486 stars 136 forks source link

getIconPath does not cope with UTF-8 month names #331

Closed macosforgebot closed 13 years ago

macosforgebot commented 13 years ago

mail@… originally submitted this as ticket:423


the getIconPath tries to look for an Icon with the month name in it.

Does this really make sense does the apple version of the calendarserver have different icons per language??!

I need:

Index: CalendarServer/twistedcaldav/mail.py
===================================================================
--- CalendarServer/twistedcaldav/mail.py        (Revision 7209)
+++ CalendarServer/twistedcaldav/mail.py        (Arbeitskopie)
@@ -990,7 +990,7 @@
             with translationTo(language) as trans:
                 monthName = trans.monthAbbreviation(month)
             iconName = "%02d.png" % (day,)
-            iconPath = os.path.join(iconDir, monthName, iconName)
+            iconPath = os.path.join(iconDir, monthName.encode("utf-8"), iconName)
             if not os.path.exists(iconPath):
                 # Try the generic (numeric) version
                 iconPath = os.path.join(iconDir, "%02d" % (month,), iconName)
macosforgebot commented 13 years ago

mail@… originally submitted this as comment:2:⁠ticket:423


Exception if the error is somewhere else:

2011-03-17 22:30:20+0100 [-] [mailgateway] 2011-03-17 22:30:20+0100 [-] [twistedcaldav.mail.MailHandler#debug] Mail gateway created token 2c8589d3-36e6-45c1-a54e-1e75edfe0579 for mailto:mail@felixmoeller.de (originator), mailto:felix@derklecks.de (recipient) and 243525d6-4082-4708-b9fa-52b8c90e9ef6 (icaluid)
2011-03-17 22:30:20+0100 [-] [mailgateway] 2011-03-17 22:30:20+0100 [-] [twext.web2.server#info] Exception rendering:
2011-03-17 22:30:20+0100 [-] [mailgateway] 2011-03-17 22:30:20+0100 [-] [twext.web2.server#error] [Failure instance: Traceback: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe4' in position 37: ordinal not in range(128)
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:345:errback
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:424:_startRunCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:441:_runCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:949:gotResult
2011-03-17 22:30:20+0100 [-] [mailgateway]      --- <exception caught here> ---
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/resource.py:310:renderHTTP
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twext/web2/static.py:127:renderHTTP
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twext/web2/resource.py:109:renderHTTP
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:893:_inlineCallbacks
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:334:http_POST
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:937:outbound
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:1004:generateEmail
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:991:getIconPath
2011-03-17 22:30:20+0100 [-] [mailgateway]      /usr/lib/python2.6/genericpath.py:18:exists
2011-03-17 22:30:20+0100 [-] [mailgateway]      ]
2011-03-17 22:30:20+0100 [-] [caldav-0]  [AuthorizedHTTPGetter,client] /usr/lib/python2.6/site-packages/twisted/web/error.py:53: exceptions.DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
2011-03-17 22:30:20+0100 [-] [caldav-0]  [AuthorizedHTTPGetter,client] [twistedcaldav.scheduling.imip#error] Could not do server-to-imip request : <twistedcaldav.scheduling.imip.ScheduleViaIMip object at 0x9ffb32c> 500 Internal Server Error
2011-03-17 22:30:20+0100 [-] [caldav-0]  [AuthorizedHTTPGetter,client] [twistedcaldav.scheduling.scheduler.ScheduleResponseQueue#error] Error during PUT for mailto:felix@derklecks.de: iMIP request failed
macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:3:⁠ticket:423

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:4:⁠ticket:423


r7843

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:5:⁠ticket:423

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:6:⁠ticket:423


Also, if the icons contain text, as these do, then yes, it makes sense to have different icons per language.