[Zope3-checkins] CVS: Zope3/src/zope/xmlpickle - ppml.py:1.5

Fred L. Drake, Jr. fred at zope.com
Wed Aug 20 11:49:58 EDT 2003


Update of /cvs-repository/Zope3/src/zope/xmlpickle
In directory cvs.zope.org:/tmp/cvs-serv29543

Modified Files:
	ppml.py 
Log Message:
give a more specific error when encountering an element that isn't
defined for XML pickles


=== Zope3/src/zope/xmlpickle/ppml.py 1.4 => 1.5 ===
--- Zope3/src/zope/xmlpickle/ppml.py:1.4	Fri Apr  4 12:27:49 2003
+++ Zope3/src/zope/xmlpickle/ppml.py	Wed Aug 20 10:49:58 2003
@@ -712,7 +712,15 @@
         if tag == 'global':
             top = self.global_(tag, top)
         else:
-            top = getattr(self, tag)(tag, top)
+            try:
+                m = getattr(self, tag)
+            except AttributeError:
+                try: tag = tag.encode('us-ascii')
+                except: pass
+                raise ValueError(
+                    "unrecognized element in XML pickle: %r" % tag)
+            else:
+                top = m(tag, top)
 
         self._append(top)
 




More information about the Zope3-Checkins mailing list