Skip to content
This repository has been archived by the owner. It is now read-only.

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

Closed
macosforgebot opened this issue Mar 17, 2011 · 5 comments
Closed

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

macosforgebot opened this issue Mar 17, 2011 · 5 comments

Comments

@macosforgebot
Copy link

@macosforgebot macosforgebot commented Mar 17, 2011

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
Copy link
Author

@macosforgebot macosforgebot commented Mar 17, 2011

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
Copy link
Author

@macosforgebot macosforgebot commented Apr 5, 2011

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

  • Owner changed from @wsanchez to @m0rgen
  • Priority changed from 5: Not set to 2: Expected
  • Milestone set to CalendarServer-3.x
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

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

  • Status changed from new to closed
  • Resolution changed from to Software changed

r7843

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

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

  • Milestone changed from CalendarServer-3.x to CalendarServer-3.1
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.