When things go badly in PyGC_Collect()

Paul Miller paul at fxtech.com
Fri Feb 27 17:33:59 CET 2004


I'm running into a situation where the first call to PyCG_Collect during a 
Py_Finalize, is dying a horrible death and throwing an exception. It is 
after *MANY* iterations of the GC loop, so I haven't pinpointed where 
exactly it is happening.

Some notes - this is with Python 2.3 BTW, on Windows.

1. this happens in some code where I'm initializing Python, doing some 
script/module stuff, finalizing Python, and then doing the process again
2. it happens on the SECOND time, during the Py_Finalize
3. it only seems to happen if I've used the zip importer
4. it DOES NOT happen in a trivial test program I wrote that doesn't have 
all the massive script baggage in my real program

My real program has all sorts of custom C types, dictionary mangles, etc. 
I'm looking for clues as to what kinds of programming problems with my 
custom types could cause PyGC_Collect to go nuts. I've tried to be very 
careful about my reference counts.







More information about the Python-list mailing list