[reportlab-users] 2.4 too many open files in-line images

Mike van der Stoop mstoop at dpia.ca
Fri Sep 3 18:35:01 EDT 2010


On 10-08-31 05:06 AM, Robin Becker wrote:

> On 19/08/2010 21:50, Steve Romanow wrote:

>> On 8/19/2010 4:48 PM, Mike van der Stoop wrote:

>>> Using report lab 2.4, Python 2.6 and having issues attaching a

>>> signature jpeg to a letter using inline technique, getting IOerror

>>> which is really too many open files error. When the letter count is

>>> small it works fine.

>>>

> ...........

>

>> I haven't seen the code, but can you close the file between letters, or

>> cache it and don't reopen it for each letter?

> .........

>

> This problem came up in the wikipedia pdf export work, I think the

> solution was to add an extra control to the ImageReader class to make

> the file opening lazy or caching/re-openable in some way. See the

> comment in reportlab/rl_config.py for the variable imageReaderFlags. I

> think wikipedia uses Ralf Schmitt's method (ie using the value -1).

> The other flag values relate to cases where the image is transient and

> may not be a file.

Worked! Setting imageReaderFlags to 2 or -1 works.

Many thanks for pointing me to the config file.

Regards,


More information about the reportlab-users mailing list