Package: python-reportlab
Version: 2.1dfsg-2
Severity: important
Tags: patch

python-reportlab_2.1dfsg-2.diff.gz currently contains the following patch:
--- python-reportlab-2.1dfsg.orig/reportlab/lib/xmllib.py
+++ python-reportlab-2.1dfsg/reportlab/lib/xmllib.py
@@ -7,7 +7,8 @@
 import string
 
 try:
-    import sgmlop   # this works for both builtin on the path or relative
+    from _xmlplus.parsers import sgmlop
+    #import sgmlop   # this works for both builtin on the path or relative
 except ImportError:
     sgmlop = None
 

This is a bad way to import sgmlop, as you can see:
>>> import xml.parsers
>>> from _xmlplus.parsers import sgmlop
>>> import xml.sax.writer
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/_xmlplus/sax/writer.py", line 146, in ?
    class _XMLDTDLoader(xml.parsers.xmlproc.xmlapp.DTDConsumer):
AttributeError: 'module' object has no attribute 'xmlproc'

For example, it breaks Zope completely if CMFReportTool product is installed.

sgmlop must be imported as follows:
diff -u python-reportlab-2.1dfsg/reportlab/lib/xmllib.py 
python-reportlab-2.1dfsg/reportlab/lib/xmllib.py
--- python-reportlab-2.1dfsg/reportlab/lib/xmllib.py
+++ python-reportlab-2.1dfsg/reportlab/lib/xmllib.py
@@ -7,7 +7,7 @@
 import string
 
 try:
-    from _xmlplus.parsers import sgmlop
+    from xml.parsers import sgmlop
     #import sgmlop   # this works for both builtin on the path or relative
 except ImportError:
     sgmlop = None


BTW, I don't understand how #468614 has been fixed, since both ways to import 
sgmlop fails without python-xml:

>>> from _xmlplus.parsers import sgmlop
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named _xmlplus.parsers

>>> from xml.parsers import sgmlop
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: cannot import name sgmlop


Anyway, why not keeping sgmlop.so in python-reportlab-accel?
This would be the more simple solution:
 * drop python-xml
 * drop the patch to python-reportlab
 * drop the deletion of sgml.so in reportlab-accel

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (400, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24.4-1 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-reportlab depends on:
ii  python                        2.5.2-1    An interactive high-level object-o
ii  python-central                0.6.1      register and build utility for Pyt

Versions of packages python-reportlab recommends:
ii  python-imaging                1.1.6-1    Python Imaging Library
pn  python-renderpm               <none>     (no description available)
ii  ttf-bitstream-vera            1.10-7     The Bitstream Vera family of free 
pn  ttf-dustin                    <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to