Martin Häcker
2014-03-12 09:57:01 UTC
While using Agilo 0.9.12 with a german locale (de_DE.utf8) we noticed
Genshi throwing a UnicodeDecodeError in '
agilo/scrum/backlog/templates/agilo_backlog.htm' on line 65.
The problem seems to be that datetime.strftime() is used, which will return
strings always in the encoding of the current locale, which then in turn
confuses genshi, which seems to expect either ascii or unicode strings, but
nothing else.
Thus a workaround for this problem is probably something along these lines:
# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Patching line 65 of 'agilo/scrum/backlog/templates/agilo_backlog.htm' with
this
<!-- decode('utf8') is neccessary, as stftime returns
different encodings depending on the locale-->
<span class="sprint-dates"
py:if="backlog.is_sprint_backlog()">${backlog.sprint().start.strftime("%a
%B %d").decode('utf8')} <span id="sprint-dates-arrow"></span>
${backlog.sprint().end.strftime("%a %B %d").decode('utf8')}</span>
Seems to be a workaround for us for this issue.
Regards,
Martin HÀcker
--
--
Follow Agilo on Twitter: http://twitter.com/agilofortrac
Please support us by reviewing and voting on:
http://userstories.com/products/8-agilo-for-scrum
http://ohloh.net/p/agilo-trac
http://freshmeat.net/projects/agiloforscrum
You have received this message because you are subscribed to
the "Agilo for Trac" Google Group. This group is focused on
supporting Agilo for Trac users and is moderated by
Agilo Software GmbH <http://www.agilosoftware.com>.
To post to this group, send email to agilo-/***@public.gmane.org
To unsubscribe from this group, send an email to
agilo+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/agilo
---
You received this message because you are subscribed to the Google Groups "Agilo for Trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agilo+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Genshi throwing a UnicodeDecodeError in '
agilo/scrum/backlog/templates/agilo_backlog.htm' on line 65.
The problem seems to be that datetime.strftime() is used, which will return
strings always in the encoding of the current locale, which then in turn
confuses genshi, which seems to expect either ascii or unicode strings, but
nothing else.
Thus a workaround for this problem is probably something along these lines:
# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import locale
locale.setlocale(locale.LC_ALL, 'de_DE.utf8')
'de_DE.utf8'locale.setlocale(locale.LC_ALL, 'de_DE.utf8')
import datetime
d = datetime.datetime.now()
d.strftime("%a %B %d")
'Mi M\xc3\xa4rz 12'd = datetime.datetime.now()
d.strftime("%a %B %d")
print d.strftime("%a %B %d").decode('utf8')
Mi MÀrz 12import locale
locale.getlocale()
('de_DE', 'UTF8')locale.getlocale()
locale.getlocale()[1]
'UTF8'd.strftime("%a %B %d").decode(locale.getlocale()[1])
u'Mi M\xe4rz 12'Patching line 65 of 'agilo/scrum/backlog/templates/agilo_backlog.htm' with
this
<!-- decode('utf8') is neccessary, as stftime returns
different encodings depending on the locale-->
<span class="sprint-dates"
py:if="backlog.is_sprint_backlog()">${backlog.sprint().start.strftime("%a
%B %d").decode('utf8')} <span id="sprint-dates-arrow"></span>
${backlog.sprint().end.strftime("%a %B %d").decode('utf8')}</span>
Seems to be a workaround for us for this issue.
Regards,
Martin HÀcker
--
--
Follow Agilo on Twitter: http://twitter.com/agilofortrac
Please support us by reviewing and voting on:
http://userstories.com/products/8-agilo-for-scrum
http://ohloh.net/p/agilo-trac
http://freshmeat.net/projects/agiloforscrum
You have received this message because you are subscribed to
the "Agilo for Trac" Google Group. This group is focused on
supporting Agilo for Trac users and is moderated by
Agilo Software GmbH <http://www.agilosoftware.com>.
To post to this group, send email to agilo-/***@public.gmane.org
To unsubscribe from this group, send an email to
agilo+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/agilo
---
You received this message because you are subscribed to the Google Groups "Agilo for Trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agilo+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.