The root cause for these problems is the same: the module holding the
destructor is garbage collected in the dying thread before the geometry
or I/O object is itself garbage collected (and tries to call the now
non-existent function).
To compound the issue, it appears that GC order changes depending on the
version of Python used, as well as the platform it is running on. In
other words, Python 2.7 on Snow Leopard won't show these errors while
Python 2.5 on Arch Linux will.
However, for the ticket you opened (#13843), the developer may prevent
these errors by _not_ creating module-level globals of GEOS geometry
objects. Here's an example of a module-level global:
from django.contrib.gis.geos import GEOSGeometry
geom = GEOSGeometry('POINT(5 23)')
def my_view():
do_something_with(geom)
Instead of having `geom` defined in the global scope, it would be better
to have it instantiated in the local scope of the view function instead.
As it stands I'm -1 on the #13843 patch. While it reduces log noise
in your case, it masks that there could be an underlying problem with
the developer's code. Regardless, I'm keeping the ticket open because
absent a technological fix, there should be at least note in the
documentation on how to avoid it.
-Justin