[reportlab-users] Error reporting: please say what image is failing

Roberto Alsina ralsina at netmanagers.com.ar
Wed Mar 17 15:30:54 EDT 2010


On Wednesday 17 March 2010 16:23:35 Mike Driscoll wrote:

> On 3/17/2010 12:35 PM, Roberto Alsina wrote:

> > I got this reported as an Issue in rst2pdf:

> > http://code.google.com/p/rst2pdf/issues/detail?id=287

> >

> > The real problem is (I think) fixed already, the error was this:

> > File "/Library/Python/2.6/site-packages/reportlab/pdfgen/canvas.py",

> > line

> >

> > 673, in drawImage

> >

> > rawdata = image.getRGBData()

> >

> > File "/Library/Python/2.6/site-packages/reportlab/lib/utils.py", line

> >

> > 651, in getRGBData

> >

> > self._dataA = ImageReader(im.split()[3])

> >

> > File "/Library/Python/2.6/site-packages/PIL/Image.py", line 1497, in

> > split

> >

> > if self.im.bands == 1:

> > AttributeError: 'NoneType' object has no attribute 'bands'

> >

> > But anyway, what the user says, which is reasonable, is that maybe if RL

> > fails when processing an image it could report what image is causing the

> > problem?

>

> Technically, that error appears to be coming from PIL, not RL. You'd

> probably need to report the feature request to their list.


Maybe reportlab can catch exceptions and report? I can't do that in rst2pdf
because I can't know what specific image is failing, reportlab can.


More information about the reportlab-users mailing list