[EMAIL PROTECTED] wrote: > Safari stores its cookies in XML format. Looking to try and add support for > it to cookielib I started by first trying to parse it with Fredrik Lundh's > elementtree package. It complained about an invalid token. Looking at the > spot it indicated in the file, I found a non-ASCII, but (as far as I can > tell) perfectly valid utf-8 string.
xml.dom.minidom gives the same error, so it's not a problem with elementtree in itself. the problematic tag contains: '[EMAIL PROTECTED]' which decodes to '[EMAIL PROTECTED]' which contains chr(1), which is an invalid XML character (at least in XML 1.0). that apple's tools are able to generate bogus XML is a known problem; for a discussion and some workarounds, see the "Status of XML 1.1 processing in Python" over at the xml-sig mailing list: http://aspn.activestate.com/ASPN/Mail/Message/xml-sig/2792071 </F> -- http://mail.python.org/mailman/listinfo/python-list