[Zope-dev] XML Export Error and Patch

Willi Langenberger wlang at wu-wien.ac.at
Wed Nov 10 17:28:41 EST 2004


When i try to export a PluggableAuthService object as XML, (with ZMI
Import/Export or with manage_exportObject?id=acl_users&download=1&toxml=Y)
i get the following exception:

  Error Type: AttributeError
  Error Value: List instance has no attribute 'extend'


  Traceback (innermost last):

    * Module ZPublisher.Publish, line 101, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module OFS.ObjectManager, line 504, in manage_exportObject
    * Module OFS.XMLExportImport, line 58, in exportXML
    * Module OFS.XMLExportImport, line 33, in XMLrecord
    * Module Shared.DC.xml.ppml, line 253, in load
    * Module pickle, line 872, in load
    * Module pickle, line 1209, in load_appends

Seems that the xml export calls the "extend" method of an
Shared.DC.xml.ppml.List object, which isnt implemented.

The following patch (implement "extend" like "append") solves the problem
(for me!):

zope at bach-s17:~$ diff -u -U10 Zope-2.7.2/lib/python/Shared/DC/xml/ppml.py.ori Zope-2.7.2/lib/python/Shared/DC/xml/ppml.py
--- Zope-2.7.2/lib/python/Shared/DC/xml/ppml.py.ori     2002-08-14 23:51:00.000000000 +0200
+++ Zope-2.7.2/lib/python/Shared/DC/xml/ppml.py 2004-11-10 23:05:55.000000000 +0100
@@ -209,20 +209,22 @@
 class Sequence(Collection):
     def __init__(self, v=None):
         if not v: v=[]
     def __len__(self): return len(self._subs)
     def append(self, v): self._subs.append(v)
+    def extend(self, v): self._subs.extend(v)
     def value(self, indent):


Willi.Langenberger at wu-wien.ac.at                Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria

More information about the Zope-Dev mailing list