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

Chris Bergstresser chris at subtlety.com
Sat Jun 20 18:47:40 EDT 2009


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\pdfgen\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.

-- Chris


More information about the reportlab-users mailing list