[reportlab-users] Possible String/Unicode bug in reportlab. Where do I report it?

Roberto Alsina ralsina at netmanagers.com.ar
Sat Jun 20 19:01:38 EDT 2009


On Saturday 20 June 2009 19:47:40 Chris Bergstresser wrote:

> Hi all --

>

> I just started using ReportLab (through the rst2pdf library) and so

> I'm not entirely sure this isn't a problem with rst2pdf, but it

> certainly looks like a ReportLab bug. When it tries to draw tables, I

> get a:

>

> ValueError: Unknown color u'black'

>

> The last line of the stack is:

>

> File

> "c:\Python26\Lib\site-packages\reportlab-2.3-py2.6-win32.egg\reportlab\pdfg

>en\textobject.py", line 98, in setStrokeColor

> raise ValueError('Unknown color %r' % aColor)

>

> ... and a brief check of the code reveals this check above it:

>

> elif type(aColor) is StringType:

> self.setStrokeColor(toColor(aColor))

>

> obviously, this fails because aColor is Unicode. (For that matter,

> toColor only accepts binary strings as well). I cannot, for the life

> of me, fathom *why*. At any rate, the fix is trivial, depending on

> the desired behavior--since I don't understand the rationale for

> refusing to accept Unicode in the first place, I'm hesitant to suggest

> a specific fix.


Since I intend to keep supporting RL 2.3, could you post a simple test case in
rst2pdf's bug tracker? Maybe it *is* rst2pdf's fault, and if it isn't I need
to create a workaround anyway :-)

--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
"Our opponent is an alien starship packed with atomic bombs, I said.
We have a protractor. Okay, I’ll go home and see if I can scrounge up a
ruler and a piece of string." — Neal Stephenson


More information about the reportlab-users mailing list