This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, scoder
Date 2008-07-25.21:03:48
SpamBayes Score 2.031153e-06
Marked as misclassified No
Message-id <1217019829.87.0.80979010518.issue3443@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-07-25 21:03:50amaury.forgeotdarcsetspambayes_score: 2.03115e-06 -> 2.031153e-06
recipients: + amaury.forgeotdarc, scoder
2008-07-25 21:03:49amaury.forgeotdarcsetspambayes_score: 2.03115e-06 -> 2.03115e-06
messageid: <1217019829.87.0.80979010518.issue3443@psf.upfronthosting.co.za>
2008-07-25 21:03:49amaury.forgeotdarclinkissue3443 messages
2008-07-25 21:03:48amaury.forgeotdarccreate