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 hoses index on load failure
Type: Stage:
Components: Extension Modules Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, currivan
Priority: normal Keywords:

Created on 2005-03-29 20:23 by currivan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg24819 - (view) Author: currivan (currivan) Date: 2005-03-29 20:23
Using python to read a dumbdbm db created with jython
on Windows, the index got erased.  The load failed with
an exception due to the python os.linesep being "\n",
while the jython version created the db with "\r\n".  

On exit, the python dumbdbm module committed the empty
index it had read, destroying the db.  commit (or sync)
is implicitly being called on exit from python.

dumbdbm ignores the flag it was opened with and commits
even if it was opened with 'r'.  jython doesn't seem to
support any other standard dbm implementation, so I'm
stuck with dumbdbm.

The problem can be worked around by setting os.linesep
manually to enforce consistency.
msg24820 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2005-06-07 19:58
Logged In: YES 
user_id=11375

Another fix, and the one I've just applied to the HEAD and
2.4-maint branches, is to strip off whitespace from the
lines in the index file.  Thanks for reporting this bug!
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41774
2005-03-29 20:23:04currivancreate