PDF Generation fails on week, month and year....

Bug #80120 reported by Alejandro Sánchez Marín
14
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
Medium
Unassigned

Bug Description

When try to print a pdf of resource's calendar, fails on week, month and year, but diary runs ok.

This is the traceback:

Exception

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 20: ordinal not in range
(128)

Traceback

File "/usr/lib/libschoolbell/Zope3/src/zope/publisher/publish.py", line 138, in publish

File "/usr/lib/libschoolbell/Zope3/src/zope/app/publication/zopepublication.py", line 164, in
callObject

File "/usr/lib/libschoolbell/Zope3/src/zope/publisher/publish.py", line 113, in mapply

Extra information: <bound method MonthlyPDFCalendarView.pdfdata of
<zope.app.publisher.browser.viewmeta.MonthlyPDFCalendarView object at 0xb1359b6c>>
File "/usr/lib/libschoolbell/Zope3/src/zope/publisher/publish.py", line 119, in debug_call

File "/usr/lib/libschoolbell/src/schoolbell/app/browser/pdfcal.py", line 86, in pdfdata

File "/usr/lib/libschoolbell/src/schoolbell/app/browser/pdfcal.py", line 99, in buildStory

File "/usr/lib/libschoolbell/src/schoolbell/app/browser/pdfcal.py", line 346, in buildEventTables

File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line 379, in __init__
  self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line 402, in _setup
  style, frags, bulletTextFrags = _parser.parse(text,style)
File "/usr/lib/python2.4/site-packages/reportlab/platypus/paraparser.py", line 798, in parse
  self.feed(text)

Tags: i18n reportlab
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Thank you for the bug report.

I think I know what causes it: PDFCalendarViewBase.daySubtitle returns a Unicode
object, and passes it directly to reportlab's Paragraph, which expects a UTF-8
encoded string. Boom!

Translated day names cause the bug; ASCII-only day names hide the bug -- this is
why the bug wasn't noticed during development.

See also issue 439 for more i18n bugs in pdfcal.py

Changed in schooltool:
status: In Progress → Unconfirmed
Changed in schooltool:
status: New → Confirmed
Changed in schooltool:
assignee: nobody → jfroche
Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Seems to be fixed.

Changed in schooltool:
assignee: jfroche → nobody
status: Confirmed → Fix Committed
Changed in schooltool:
status: Fix Committed → 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.