On Nov 19, 2012, at 1:31 PM, [email protected] wrote:
> "/SW/python/x86_64_cs4/2.7/lib/python2.7/site-packages/rdkit/sping/PIL/pidPIL.py",
> line 331, in drawString
>    if not pilfont: raise "bad font!", font
> TypeError: exceptions must be old-style classes or derived from
> BaseException, not str
> "

Wow. This means that no one uses the combination of PIL and Python 2.6+
for drawing images, and had a font error.

String exceptions were replaced with class exceptions back in 1997, and
removed from Python with 2.6. The pidPIL.py code is from 1999:

# piddlePIL.py -- a Python Imaging Library backend for PIDDLE
# Copyright (C) 1999  Joseph J. Strout

There are two lines which should change to get rid of the string
exceptions. The line 153

      raise 'fileobj not implemented for piddlePIL'

should probably be

      raise TypeError('fileobj not implemented for piddlePIL')

and the line 331

    if not pilfont: raise "bad font!", font

should probably be

    if not pilfont: raise ValueError("bad font! %r" % font)


In any case, it's saying that the font that you asked for doesn't exist in PIL.

What font are you using?



                                Andrew
                                [email protected]



------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to