xml.minidom and threads

Sunil Movva sunilmovva at hotmail.com
Tue Mar 16 18:08:45 CET 2004

and-google at doxdesk.com (Andrew Clover) wrote in message news:<2c60a528.0403150103.1896dbbc at posting.google.com>...
> Sunil Movva <sunilmovva at hotmail.com> wrote:
> > So, I came to suspect if xml.minidom module is thread-safe. 
> No it isn't, but I doubt this is your problem as you don't seem to be
> trying to access the DOM Nodes from multiple threads, let alone
> concurrently. (Is there any good reason why you need to serialise and
> re-parse between each thread?)
> A SAXParseException is generally what it says on the tin, caused by
> faulty syntax in the XML document being parsed. It is conceivable that
> minidom's serialisation code at the second-thread-output stage is
> producing something wrong; we'd have to have a look at the string the
> third thread is trying to parse to find out what.

I was able to fix this problem. It has nothing to do with
thread-safety. The function  xml.dom.minidom.parseString() throws
invalid token exception on trying to parse unicode strings. I forced
my app to use regular strings instead.

Thanks for the response.

More information about the Python-list mailing list