xml_pickle load problem

Dan dan at eloff.info
Mon Jul 26 18:28:51 CEST 2004


I also failed to get load to work, but I received a different error. I
tried contacting David Mertz twice, but either he's very busy or the
spam filter he made for himself is horrible. I just switched to cPickle,
from a python perspective it is more portable and less error prone. I
don't have any real need to load or save python objects from other
languages. It's also many times faster and smaller. I'd be interested if
you find the solution to this. You might want to verify that the xml
file is valid according to the dtd.

-Dan

Hi everybody,

I use xml_pickle to write xml files.
Trying to load them with:

                     xml_str = f.read()
                     xml_pickle.MyClass = MyClass
                     obj = xml_pickle.XML_Pickler().loads(xml_str))
                     f.close()

ends with an error:

Traceback (most recent call last):
   File "C:\Programme\Python23\wxOSP_geht\xml_pickle.py", line 587, in ?
     t = o.loads(s)
   File "C:\Programme\Python23\wxOSP_geht\xml_pickle.py", line 224, in
loads
     obj = self.load(fh)
   File "C:\Programme\Python23\wxOSP_geht\xml_pickle.py", line 198, in
load
     return thing_from_dom(parse_string)
   File "C:\Programme\Python23\wxOSP_geht\xml_pickle.py", line 242, in 
thing_from_dom
     id = node.attributes[('', 'id')].value
TypeError: unsubscriptable object


Anybody knows how to get rid of the error?
Thanks for any hints,

Markus
-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list