[issue3299] Direct calls to PyObject_Del/PyObject_DEL are broken for --with-pydebug

STINNER Victor report at bugs.python.org
Thu Jan 14 23:24:24 CET 2010


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Patch for cElementTree:
 * Replace PyObject_Del() by Py_DECREF()
 * Catch element_new_extra() errors
 * parser dealloc: replace Py_DECREF() by Py_XDECREF() because the pointer may be NULL (error in the constructor)
 * set all parser attributes to NULL at the beginning of the constructor to be able to call safetly the destructor
 * element_new(): define tag, text, tail attributes before calling element_new_extra() to be able to call the destructor
 * raise a MemoryError on element_new_extra() failure. element_new() didn't raise any error on element_new_extra() failure. Other functions just forget to catch element_new_extra() error.

----------
Added file: http://bugs.python.org/file15887/celementtree_py_decref.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3299>
_______________________________________


More information about the Python-bugs-list mailing list