This is a feature which I have encountered in 2 different environments. This is (perhaps)
due to the fact, that some internal caching or namespace settings gets messed up. This does
_not_ happen, if using some internal fonts, only if using _custom_ fonts.
traceback looks like:
Traceback (most recent call last):
File "d:\pub\webkit\tst\spotpdfmaker.py", line 272, in run
File "d:\pub\pylib\spm\__init__.py", line 200, in create_pdf
File "d:\pub\pylib\spm\__init__.py", line 72, in draw_matrix
File "c:\python\reportlab\pdfbase\pdfmetrics.py", line 438, in __init__
File "c:\python\reportlab\pdfbase\pdfmetrics.py", line 494, in _loadMetrics
File "c:\python\reportlab\pdfbase\pdfmetrics.py", line 543, in registerEncoding
File "c:\python\reportlab\pdfbase\pdfmetrics.py", line 249, in isEqual
return ((enc.name == other.name) and (enc.vector == other.vector))
NameError: global name 'enc' is not defined
These environments, in which the same thing happens, are Zope and Webware. The catch here is,
that everyting works fine, when reportlab -module is loaded (used) the first time. Following
attemts to use module results in the crash above.
Zope and Webware are environments, which cache code and data for performance boost. it seems
that this is not what reportlab takes care of. Or takes, but it has a bug in it.
Well, there are a simple workaround too, for this feature. Just use construction:
# it is loaded allready
but this is not very convenient for obvious reasons.