Bug 625019 - BugzillaBase.__del__ seems to be unsafe
Summary: BugzillaBase.__del__ seems to be unsafe
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-bugzilla
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-18 11:17 UTC by Martin Bacovsky
Modified: 2012-02-04 22:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-04 22:40:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch fixing the issue (914 bytes, application/octet-stream)
2010-08-18 11:17 UTC, Martin Bacovsky
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.