[Python-Dev] UNREF invalid object

Gustavo Niemeyer niemeyer@conectiva.com
Mon, 10 Feb 2003 01:35:12 -0200


Hello!

I've been playing with the bz2module to remove the file inheritance, as
requested. While doing so, I've got the "UNREF invalid object" error
when trying to run PyObject_Del(), inside a dealloc function, on an
object which is not "externally" accessible (it's part of the class
structure only, and has obj->ob_refcnt == 1, as expected). I'll replace
the PyObject_Del() by Py_DECREF() which fixes the problem and feels more
elegant to me anyway.  OTOH, I wouldn't like to get over the problem
without knowing what's really happening. Is this a common problem
pattern?

Thanks!

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]