Bug 625019

Summary: BugzillaBase.__del__ seems to be unsafe
Product: [Fedora] Fedora Reporter: Martin Bacovsky <mbacovsk>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: crobinso, jskarvad, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-04 22:40:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch fixing the issue none

Description Martin Bacovsky 2010-08-18 11:17:29 UTC
Created attachment 439364 [details]
Patch fixing the issue

Description of problem:
After running one of the Fedora PkgDB tests am writing I'm experiencing such a weird message:
Exception TypeError: "'NoneType' object is not callable" in <bound method RHBugzilla3.__del__ of <bugzilla.rhbugzilla.RHBugzilla3 object at 0x37c1810>> ignored

After some investigation I found out that the problem is caused by calling os.remove(self.cookiefile) during BugzillaBase.__del__. The os module seems to be partly torn down as is mentioned in Warning part here http://docs.python.org/reference/datamodel.html#object.__del__. 

It helped to keep reference to the method in the object as can be seen in the patch.

I have never met such behaviour before and am not sure if I'm interpreting it well. I'm also not aware of anything unusual in my code that may be causing this. The attached patch fixed the issue for me.

Version-Release number of selected component (if applicable):
python-bugzilla-0.6.1-1.fc13.noarch

How reproducible:
Always in this particular usecase. I didn't tried it on another machine though. Not trivial to setup, but if you are interested let me know.

Comment 1 Will Woods 2011-06-01 21:29:01 UTC
I've pushed a patch to python-bugzilla git that should fix this:

http://git.fedorahosted.org/git/?p=python-bugzilla.git;a=commitdiff;h=f2d81c5

If you can try to reproduce the problem with a git checkout that'd be really helpful. Thanks!

Comment 2 Cole Robinson 2012-02-04 22:40:12 UTC
It appears this patch is in f16 and rawhide, so closing.