[reportlab-users] CJK fun: AttributeError: FragLine instance has no attribute 'fontName'

Marius Gedminas marius at gedmin.as
Fri May 29 15:53:45 EDT 2009


Using svn rev 3484 (which is the current HEAD), I'm getting this error
on Ubuntu 6.06:

Traceback (innermost last):
...
File .../reportlab-2.3+svn3484/src/reportlab/platypus/paragraph.py, line 843, in wrap
blPara = self.breakLinesCJK([first_line_width, later_widths])
File .../reportlab-2.3+svn3484/src/reportlab/platypus/paragraph.py, line 1227, in breakLinesCJK
return cjkFragSplit(self.frags, maxWidths, calcBounds)
File .../reportlab-2.3+svn3484/src/reportlab/platypus/paragraph.py, line 733, in cjkFragSplit
lines.append(makeCJKParaLine(U[lineStartPos:i],extraSpace,calcBounds))
File .../reportlab-2.3+svn3484/src/reportlab/platypus/paragraph.py, line 684, in makeCJKParaLine
if not _sameFrag(f0,f):
AttributeError: FragLine instance has no attribute 'fontName'

Strangely, the same code works fine on Ubuntu 8.04. Something different
in the build environment? A different minor version of Python (Dapper
has Python 2.4.3, Hardy has 2.4.5)?

This smells like a bug in _rl_accel.c, since the Python version of
_sameFrag uses getattr(f, 'fontName', None) and therefore doesn't
require that attribute to exist.

Of course I had to notice this right after telling the client that we
now have working Chinese support, *sigh*.

Marius Gedminas
--
Voodoo Programming: Things programmers do that they know shouldn't work but
they try anyway, and which sometimes actually work, such as recompiling
everything.
-- Karl Lehenbauer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090529/db12f7ed/attachment.pgp>


More information about the reportlab-users mailing list