RE: xml_pickle load problem

Discussion in 'Python' started by Dan, Jul 26, 2004.

  1. Dan

    Dan Guest

    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
     
    Dan, Jul 26, 2004
    #1
    1. Advertising

  2. Dan wrote:
    > 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.


    ...hmm, I did not have any problems with xml_pickle when I used it a
    while ago, HOWEVER, the dtd is NOT accurate. I contacted David Mertz
    about this issue and he confirmed that the dtd was outdated, I even did
    a patch that got my dump validating, don't know what's happened with it
    since.

    don't know if it makes any difference, but I used it the way that's most
    similar to "normal" pickle

    /Simon
     
    Simon Dahlbacka, Jul 26, 2004
    #2
    1. Advertising

  3. "Dan" <> wrote in message news:<>...
    > 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 did not get any note from Dan; nor can I find evidence of it in my
    spam filter. At least the string 'eloff' doesn't occur in the
    filtered mail. Maybe he wrote from some other address. I also don't
    find 'xml_pickle' in flagged headers; but who knows what subject line
    might have been used.

    > xml_str = f.read()
    > xml_pickle.MyClass = MyClass
    > obj = xml_pickle.XML_Pickler().loads(xml_str))
    > f.close()
    > Traceback (most recent call last):
    > File "C:\Programme\Python23\wxOSP_geht\xml_pickle.py", line 587, in ?
    > t = o.loads(s)


    Anyway... this appears to be an ANCIENT version of xml_pickle. It's
    been a couple years since the module was incorporated into
    Gnosis.Utilities, and the module called gnosis.xml.pickle. I'm happy
    to look at any bugs users encounter, but I'm not going to worry too
    much about a three year old version. Try a more recent one first.

    It *is* true that the DTD for gnosis.xml.pickle is out of date. I
    know I should fix that for the next release. I'll try to find time.
    But a DTD is not mostly necessary anyway.
     
    David Mertz, Ph.D., Jul 30, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    7
    Views:
    1,174
    Emma Gumbdough
    Jun 30, 2004
  2. venky

    Page Load and webcontrol page load

    venky, Jul 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,119
    venky
    Jul 11, 2005
  3. roni
    Replies:
    1
    Views:
    650
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Aug 30, 2005
  4. Markus von Ehr

    xml_pickle load problem

    Markus von Ehr, Jul 26, 2004, in forum: Python
    Replies:
    0
    Views:
    296
    Markus von Ehr
    Jul 26, 2004
  5. David Shen

    Problem with xml.load & xsl.load in JSP

    David Shen, Aug 28, 2003, in forum: Javascript
    Replies:
    0
    Views:
    116
    David Shen
    Aug 28, 2003
Loading...

Share This Page