classification
Title: Minor bug in 2.6.4 related to cleanup at end of program
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Jesse.Aldridge, cburroughs, georg.brandl, r.david.murray
Priority: normal Keywords: easy, patch

Created on 2010-02-02 00:57 by Jesse.Aldridge, last changed 2010-05-04 19:20 by cburroughs. This issue is now closed.

Files
File name Uploaded Description Edit
shelve-clean-shutdown.patch r.david.murray, 2010-02-02 02:52
Messages (6)
msg98703 - (view) Author: Jesse Aldridge (Jesse.Aldridge) Date: 2010-02-02 00:57
http://stackoverflow.com/questions/2180946/really-weird-issue-with-shelve-python
msg98704 - (view) Author: Jesse Aldridge (Jesse.Aldridge) Date: 2010-02-02 01:03
I ran into an error while trying to use the shelve module.  Alex Martelli seemed to think I was running into a python bug.  He suggested I file a bug report.  For more info see:  http://stackoverflow.com/questions/2180946/really-weird-issue-with-shelve-python
msg98708 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-02-02 02:52
Here's a patch that fixes the problem for shelve.  For the more general problem with Python shutdown and module cleanup, see issue 812369.

I can come up with a sort-of unit test for this (setting _ClosedDict to None, calling close to prove it doesn't generate an error, and restoring _CloseDict), but it is rather artificial, since the real bug involves __del__ getting called during shutdown after module finalization.  So I'm not sure the unit test is worthwhile.
msg98986 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-02-07 09:36
I'd say go ahead and commit without test.
msg99185 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-02-11 00:29
Committed in r78137 to trunk, r78138 py26, r78139 py3k, and r78140 py31.
msg99191 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-02-11 02:17
Fix modified to catch the case where the shutdown has also deleted module dictionary, at MAL's suggestion, in r78142.
History
Date User Action Args
2010-05-04 19:20:14cburroughssetnosy: + cburroughs
2010-02-11 02:17:30r.david.murraysetmessages: + msg99191
2010-02-11 00:29:52r.david.murraysetstatus: open -> closed
messages: + msg99185

components: + Library (Lib), - Interpreter Core
resolution: fixed
stage: patch review -> resolved
2010-02-07 09:36:28georg.brandlsetnosy: + georg.brandl
messages: + msg98986
2010-02-02 02:52:07r.david.murraysetfiles: + shelve-clean-shutdown.patch
priority: normal

versions: + Python 3.1, Python 2.7, Python 3.2
keywords: + easy, patch
nosy: + r.david.murray

messages: + msg98708
stage: patch review
2010-02-02 01:03:06Jesse.Aldridgesetmessages: + msg98704
2010-02-02 00:57:45Jesse.Aldridgecreate