[Python-modules-team] Bug#750460: python-pisa: fails with python-reportlab version 3 or higher

Jamie McClelland jm at mayfirst.org
Tue Jun 3 14:54:41 UTC 2014


Package: python-pisa
Version: 3.0.32-1
Severity: grave
Tags: patch
Justification: renders package unusable

Dear Maintainer,

When running xhtml2pdf I get the following backtrace:

0 jamie at animal:cdtemp.yjGXVb$ xhtml2pdf /home/iceweasel/Downloads/page.break.html page.break.pdf 
****************************************************
IMPORT ERROR!
Reportlab Version 2.1+ is needed!
****************************************************

The following Python packages are required for PISA:
- Reportlab Toolkit >= 2.2 <http://www.reportlab.org/>
- HTML5lib >= 0.11.1 <http://code.google.com/p/html5lib/>

Optional packages:
- pyPDF <http://pybrary.net/pyPdf/>
- PIL <http://www.pythonware.com/products/pil/>

No handlers could be found for logger "sx.pisa3"
Traceback (most recent call last):
  File "/usr/bin/xhtml2pdf", line 9, in <module>
    load_entry_point('pisa==3.0.32', 'console_scripts', 'xhtml2pdf')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2431, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2147, in load
    ['__name__'])
  File "/usr/lib/pymodules/python2.7/sx/pisa3/__init__.py", line 31, in <module>
    from pisa import *
  File "/usr/lib/pymodules/python2.7/sx/pisa3/pisa.py", line 21, in <module>
    from pisa_document import *
  File "/usr/lib/pymodules/python2.7/sx/pisa3/pisa_document.py", line 11, in <module>
    from pisa_context import pisaContext
  File "/usr/lib/pymodules/python2.7/sx/pisa3/pisa_context.py", line 11, in <module>
    from pisa_util import *
  File "/usr/lib/pymodules/python2.7/sx/pisa3/pisa_util.py", line 44, in <module>
    raise ImportError("Reportlab Version 2.1+ is needed!")
ImportError: Reportlab Version 2.1+ is needed!
1 jamie at animal:cdtemp.yjGXVb$

The problem seems to be that python-pisa checks for python-reportlab version 2
that is higher 2.2, but doesn't allow versions of python-reportlab with a major
version higher than 2.

This patch fixes the problem:

0 jamie at animal:pisa3$ diff -u /usr/lib/pymodules/python2.7/sx/pisa3/pisa_util.py.orig /usr/lib/pymodules/python2.7/sx/pisa3/pisa_util.py
--- /usr/lib/pymodules/python2.7/sx/pisa3/pisa_util.py.orig 2014-06-03 10:46:10.737920398 -0400
+++ /usr/lib/pymodules/python2.7/sx/pisa3/pisa_util.py  2014-06-03 10:44:08.717746252 -0400
@@ -40,10 +40,10 @@
 
 rgb_re = re.compile("^.*?rgb[(]([0-9]+).*?([0-9]+).*?([0-9]+)[)].*?[ ]*$")
 
-if not(reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"):
+if not((reportlab.Version[0] == "2" and reportlab.Version[2] >= "1") or reportlab.Version[0] > 2):
     raise ImportError("Reportlab Version 2.1+ is needed!")
 
-REPORTLAB22 = (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2")
+REPORTLAB22 = ((reportlab.Version[0] == "2" and reportlab.Version[2] >= "2") or reportlab.Version[0] > 2)
 # print "***", reportlab.Version, REPORTLAB22, reportlab.__file__
 
 import logging
1 jamie at animal:pisa3$ 

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-pisa depends on:
ii  python            2.7.6-2
ii  python-html5lib   0.999-3
ii  python-imaging    2.3.0-2
ii  python-pypdf      1.13-1
ii  python-reportlab  3.0-1
ii  python-support    1.0.15

python-pisa recommends no packages.

python-pisa suggests no packages.

-- no debconf information



More information about the Python-modules-team mailing list