[ python-Bugs-1172763 ] dumbdbm hoses index on load failure

SourceForge.net noreply at sourceforge.net
Tue Jun 7 21:58:08 CEST 2005


Bugs item #1172763, was opened at 2005-03-29 15:23
Message generated for change (Comment added) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1172763&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: currivan (currivan)
>Assigned to: A.M. Kuchling (akuchling)
Summary: dumbdbm hoses index on load failure

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: A.M. Kuchling (akuchling)
Date: 2005-06-07 15:58

Message:
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!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1172763&group_id=5470


More information about the Python-bugs-list mailing list