Dbm Error 3.2
User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue11491 classification Title: dbm.open(..., flag="n") raises dbm.error if file exists and is rejected by whichdb Type: behavior Stage: resolved Components: Library (Lib) Versions: Python 2.7 process Status: closed Resolution: fixed Dependencies: Superseder: Assigned To: brian.curtin Nosy List: brian.curtin, denversc, eric.araujo, python-dev, r.david.murray Priority: normal Keywords: patch Created on 2011-03-14 06:42 by denversc, last changed 2014-10-03 23:58 by r.david.murray. This issue is now closed. Files File name Uploaded Description Edit dbm_open_n_flag_error_invalid_file_fix_v1.patch denversc, 2011-03-14 06:42 Proposed Fix (version 1) review issue11491.diff brian.curtin, 2011-03-14 17:40 review Messages (8) msg130791 - (view) Author: Denver Coneybeare (denversc) * Date: 2011-03-14 06:42 dbm.open() with flag="n" raises dbm.error if the given file exists but whichdb doesn't recognize it. In the documentation for dbm.open() the "n" flag is documented to "Always create a new, empty database, open for reading and writing". To me, this implies that if the file exists it will unconditionally be overwritten with a newly-created database, irrespective of its contents. The code below illustrates a scenario (and indeed the scenario that I ran into) where dbm.open(..., flag="n") will throw dbm.error when it should just blow away the existing file and create a new, empty database: import dbm open("test.db", "w").close() # create empty file dbm.open("test.db", flag="n") The cause of the exception is that within dbm.open() there is a call to whichdb to determine the file type. The fix would be to skip this whichdb check if the "n" flag is specified. I don't think that this change will cause backward compatibility issues, since I find it hard to believe that existing application
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Use python 2 shelf in python https://bugs.python.org/issue11491 3 up vote 1 down vote favorite I have data stored in a shelf file created with python 2.7 When I try to access the file from python 3.4, I get an error: >>> import shelve >>> population=shelve.open('shelved.shelf') Traceback (most recent call last): File "
BMO. For more details see Persona Deprecated. Last Comment Bug69752 - NSS / DBM error tracking bug Summary: NSS / DBM error tracking bug Status: RESOLVED FIXED Whiteboard: Keywords: Product: https://bugzilla.mozilla.org/show_bug.cgi?id=69752 NSS Classification: Components Component: Libraries (show other bugs) Version: 3.0 Platform: All All Importance: P1 major (vote) TargetMilestone: 3.4 Assigned To: Wan-Teh Chang QA Contact: Sonja Mirtitsch TriageOwner: Mentors: URL: Depends on: 39465 69753 72014 Blocks: Show dependency tree /graph Reported: 2001-02-21 22:50 PST by Nelson Bolyard (seldom reads bugmail) Modified: 2002-01-25 15:20 PST (History) CC List: 1 user (show) rrelyea See Also: Crash Signature: (edit) QA Whiteboard: Iteration: --- dbm error Points: --- Tracking Flags: Attachments Add an attachment (proposed patch, testcase, etc.) Description Nelson Bolyard (seldom reads bugmail) 2001-02-21 22:50:39 PST There are quite a few problems with DBM, as used by NSS. Some of the problems are specific to Win32, but others are not. This bug exists to track all the DBM bugs that affect NSS. Comment 1 Nelson Bolyard (seldom reads bugmail) 2001-03-14 15:48:44 PST In NSS 3.2 and later, dbm error 3.2 DBM is now linked into libnss3.so. We've produced DBM 155 with some fixes for use with NSS 2.85, but NSS 3.2 doesn't have those fixes. So, a new DS 4.1x, built from NSS 2.8x and DBM 1.55 will have those fixes, but a new DS 5.x, built from NSS 3.2, will not have them. Should we plan an NSS 3.2.1 with DBM 1.5.5 and possibly other changes? Should we put DBM into its own DSO? Comment 2 Wan-Teh Chang 2001-06-21 18:07:22 PDT Nelson, this bug is fixed in NSS 3.2.1, right? Comment 3 Nelson Bolyard (seldom reads bugmail) 2001-06-21 18:55:51 PDT I do not know what version of DBM was used to build the NSS 3.2.1 DSOs. Was it DBM from mozilla or DBM from /m/src? and which version ? So, I do not know whether the fix for this bug was in NSS 3.2.1 or not. AFAIK, the fix for OS/2 is not yet checked in, and I'm also not sure about Macintosh (see comments near the end of bug 69753). Comment 4 Robert Relyea 2001-06-22 08:38:20 PDT I'm pretty sure 3.2.1 was built from /m/src. future builds should be built from mozilla, we should schedule with Anthony when this should happen. bob Comment 5 Wan-Teh Chang 2001-06-22 11:38:30 PDT After reading Nelson's comm