Message73328
> gc.collect() is just a rude way to display this "XXX undetected error".
> (Victor: does Fusil check for this? gc.collect() will not fail if there
> is another exception in-between, or in debug mode)
I stopped to fuzz Python using --pydebug because a critical design error in
CPython reference counting: http://bugs.python.org/issue3299 (some modules
use PyObject_DEL() instead of Py_DECREF() whereas PyObject_DEL() creates
inconsistent objects in the double linked object list). Since nobody cares
about this issue, I don't use pydebug anymore.
> Now, to the _bsddb module: in general, the following pattern is wrong:
> dummy = someFunction();
> Py_XDECREF(dummy);
> because it does nothing about an eventual exception set. If the
> exception can be discarded, PyErr_Clear() must be called.
Well, we have to choices: don't raise an error, or clear the exception if an
exception is raised.
> I think there is an invariant to keep in each function: return NULL if
> and only if an exception is set. Many places in _bsddb do not respect this.
Where? dealloc() callback prototype is "void tp_dealloc(...)": no result! It's
not possible to tell Python that an error occured. |
|
Date |
User |
Action |
Args |
2008-09-17 09:38:34 | vstinner | set | recipients:
+ vstinner, jcea, amaury.forgeotdarc |
2008-09-17 09:38:04 | vstinner | link | issue3885 messages |
2008-09-17 09:38:04 | vstinner | create | |
|