Incorrect use of i18n in pdfcal.py

Bug #80121 reported by Marius Gedminas
10
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
Low
Unassigned

Bug Description

I was trying to fix an unrelated issue (issue 431) recently, when I noticed some
buggy code in pdfcal.py. It did things like

   foo_fmt = _("Bla bla: %s")
   foo = translate(foo_fmt) % something.encode('UTF-8')

translate returns a Unicode string, and the code tries to stuff it with UTF-8
data --> boom! Correct code is

   foo = _("Bla bla: $(something)")
   foo.mapping = {'something': something}
   foo = translate(foo).encode('UTF-8')

This bug is present in ST 0.11.2, SB 1.2.2 and ST trunk.

I suspect there may be other i18n related bugs in pdfcal.py, given this one, and
also issue 438. An hour spent testing pdfcal/reviewing the code would be an
hour well spent.

Changed in schooltool:
status: New → Triaged
Changed in schooltool:
importance: Medium → Low
tags: added: i18n
tags: added: calendar reports
Changed in schooltool:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.