Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: I reproduced the problem on Windows. The exception shown is the AttributeError('next') raised and caught in lxml._elementpath.find(). The "args" atribute is cleared in the BaseException_clear, during a call to gc.collect() (in some tearDown() method). Unfortunately this exception is still shomehow stored in the thread state structure...
After some researches, I think that the problem is in Cython. Cython tries to simulate a python frame without using the interpreter loop. But at least an invariant is not respected: when a frame exits without an exception set, the tstate->exc_type (and friends) should be NULL. For example, at the end of the PyInit_etree() function (called by an "import lxml.etree"), the tstate->exc_value contains an AttributeError('module' object has no attribute 'unicode'). Now, the consequence may be that all these exceptions are "implicitely chained" together. And there may be a subtle refcounting bug that shows up only if this invariant is not respected. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3443> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com