Issue #1221 invalid

Always getting 500 error

JustfixingCherryPy Notneeded
created an issue

Hello ... I'm trying to fix this problem, it's been on going for months now, sometimes it happens sometimes it does not, we can't track it down to anything specific ... You'll find the actually error after my message. I have tried to change line 1024 from W /= x to anything else and no matter what else I set it to, it breaks on the same line.

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 610, in respond
    cherrypy.response.finalize()
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 872, in finalize
    content = self.collapse_body()
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 845, in collapse_body
    newbody = ''.join([chunk for chunk in self.body])
  File "/srv/enterprise_pics/src/controllers/pdf.py", line 24, in index
    pdf = Files.pdf.Pdf(company, url).generate()
  File "/srv/enterprise_pics/src/Files/pdf.py", line 39, in generate
    pdf = pisa.CreatePDF(htmlObj, pdfObj, raise_exception=False)
  File "build/bdist.linux-x86_64/egg/xhtml2pdf/document.py", line 131, in pisaDocument
    doc.build(context.story)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 892, in build
    self.handle_flowable(flowables)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/doctemplate.py", line 775, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/frames.py", line 174, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 109, in drawOn
    self._drawOn(canvas)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 90, in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1367, in draw
    self._drawCell(cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight))
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1475, in _drawCell
    v.drawOn(self.canv,x,y)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 1077, in drawOn
    _Container.drawOn(self, canv, x, y, _sW=_sW, scale=scale)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 844, in drawOn
    c.drawOn(canv,x,y,_sW=aW-w)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 109, in drawOn
    self._drawOn(canvas)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 90, in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1367, in draw
    self._drawCell(cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight))
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1475, in _drawCell
    v.drawOn(self.canv,x,y)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 1077, in drawOn
    _Container.drawOn(self, canv, x, y, _sW=_sW, scale=scale)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 844, in drawOn
    c.drawOn(canv,x,y,_sW=aW-w)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 109, in drawOn
    self._drawOn(canvas)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 90, in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1367, in draw
    self._drawCell(cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight))
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 1458, in _drawCell
    w, h = self._listCellGeom(cellval,colwidth,cellstyle,W=W, H=H,aH=rowheight)
  File "build/bdist.linux-x86_64/egg/xhtml2pdf/xhtml2pdf_reportlab.py", line 710, in _listCellGeom
    return Table._listCellGeom(self, V, w, s, W=W, H=H, aH=aH)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/tables.py", line 396, in _listCellGeom
    vw, vh = v.wrapOn(canv, aW, aH)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 120, in wrapOn
    w, h = self.wrap(aW,aH)
  File "build/bdist.linux-x86_64/egg/xhtml2pdf/xhtml2pdf_reportlab.py", line 693, in wrap
    return KeepInFrame.wrap(self, availWidth, availHeight)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 1043, in wrap
    W, H = func(s1)
  File "/usr/local/lib/python2.7/site-packages/reportlab/platypus/flowables.py", line 1024, in func
    W /= x
ZeroDivisionError: float division by zero

Powered by CherryPy 3.1.1 

Comments (3)

  1. Joseph Tate

    This doesn't look like a bug in CherryPy. It's in the PDF generator or reportlab.

    On Thu, Mar 14, 2013 at 4:06 PM, JustfixingCherryPy Notneeded <

  2. Joel Rivera

    This is not a cherrypy issue, the traceback points out to reportlab, which is wrapped by pisa. The problem could be in the parameters to the pdf generation which is a subject of a mailing list, not a bug in cherrypy.

  3. Log in to comment