[Python-au] corrupted dictionaries

Matthew Hawkins matthew@topic.com.au
Fri, 25 Jan 2002 11:58:04 +1100


I've got a simple little script that's using xml.dom.minidom to parse 3
xml files and amalgamate them.  I've got a class that stores the data
for each unique entry (taken by uri) and a dictionary keyed by uri that
stores the instance of the class.  On the class is a __repr__ method
that simply prints out the data it has.

The problem I'm having is that the uri is corrupting.  There's about
3000 instances of the class, the uri is going in fine however some time
between going in and being printed out, it gets truncated.  I've
developed it under 2.2 but I've tested on separate systems that have 2.1
and 2.0 (I used too many 2.x-isms to try 1.5.2 ;) and they all have the
same problem.

It doesn't happen to every instance, and without modifying any code its
always the same instance(s) that get corrupted.  I'm doing no
manipulation whatsoever on the uri between it going in fine and it
coming out truncated.

I do have some 'del' statements wiping out stuff, but the problem occurs
identically regardless of the presence or absence of them (I initially
thought that perhaps the python garbage collector was nuking stuff out
from under me)

Any ideas?

-- 
Matt