I experienced an "AttributeError" with the following Python code:
Def SomeFunc(Self):
....
setattr(Self, "_Some_Attribute", Data)
....
if hasattr(Self, "_Some_Attribute"):
delattr(Self, "_Some_Attribute")
....
And the AttributeError was raise on the delattr line immediately after the hasattr test was positive. The panic was pretty rare. I would say once in few hundreds times.
SomeFunc() may be called from multiple threads. Is it possible that another thread get in between the hasattr and delattr to remove the "_Some_Attribute" after the first thread test hasattr positive?