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.

classification
Title: dumbdbm: Update bug
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, fdrake
Priority: normal Keywords: patch

Created on 2000-07-06 01:29 by akuchling, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None akuchling, 2000-07-06 01:29 None
Messages (3)
msg33069 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2000-07-06 01:29
 
msg33070 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-07-10 03:52
Back to Andrew for checkin.
msg33071 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2000-07-06 01:33
Patch from Joe Eaton <jeaton@hostway.net>.  His comments:
There is a silly bug in the fall-back dumbdbm.py database package in the
Python 1.5.2 standard distro.  This bug causes any changes to an
existing item to generate a new key, even when the key already exists.
After many updates, the .dir file used by dumbdbm grows to a huge size,
and can cause filesystem problems.

Here is a simple .py script to give an example:


#!/usr/bin/env python
import shelve
S=shelve.open('Test')
for i in range (2000):
   S['1'] = `i`

This simply replaces the item '1' 2000 times. A look at the file
Test.dir will show 2000 copies of the line
'1' (0, 4)
when just 1 is needed!

... simply remove the _addkey call to prevent extraneous keys from popping
in.
Should save diskspace for alot of people!

[amk] Eyeballing it, the patch looks correct to me, and it
*does* fix the problem.    
History
Date User Action Args
2022-04-10 16:02:03adminsetgithub: 32523
2000-07-06 01:29:33akuchlingcreate