[reportlab-users] Intermittent failure to find font, followed by IOError

Robin Becker robin at reportlab.com
Tue Jan 20 06:30:36 EST 2009


Andy Robinson wrote:

> 2009/1/20 Robin Becker <robin at reportlab.com>:

>> Resetting of reportlab is done after each request using

>>

>> from reportlab.rl_config import _reset

>> _reset()

>

> So should web apps do this on every hit?


This depends on the forking/spawning model that's being used. If the process
that's spawned is small and uninitialized then each one starts out fresh, but
presumably if they get re-used over and over then the problem exists so yes.


> and is it expensive i.e. does it reload all fonts?


If you regard that as expensive then yes, so either you need to load all fonts
at process start or you need to make each request completely self contained.

I believe it's safer to have the application in a known state at the start of
each request ie you should make no assumptions about resource availability.
--
Robin Becker


More information about the reportlab-users mailing list