Home > dbm error > dbm error 3.2

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 "", line 1, in File "C:\Python34\lib\shelve.py", line 239, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "C:\Python34\lib\shelve.py", line 223, in __init__ Shelf.__init__(self, http://stackoverflow.com/questions/27493733/use-python-2-shelf-in-python-3 dbm.open(filename, flag), protocol, writeback) File "C:\Python34\lib\dbm\__init__.py", line 88, in open raise error[0]("db type could not be determined") dbm.error: db type could not be determined I'm still able to access the shelf with no problem in python 2.7, so there seems to be a backward-compatibility issue. Is there any way to directly access the old format with the new python version? python python-2.7 python-3.x share|improve this question asked Dec 15 '14 at 21:45 Eric Myers 185 Yup, I can reproduce this. –matsjoyce Dec 15 '14 at 21:47 Can't you just convert the source to 3 using the 2to3 tool? –Bhargav Rao Dec 15 '14 at 21:50 add a comment| 4 Answers 4 active oldest votes up vote 2 down vote The shelve module uses Python's pickle, which may require a protocol version when being accessed between different versions of Python. Try supplying protocol version 2: population = shelve.open('shelved.shelf', protocol=2) According to the documentation: Protocol version 2 was introduced in Python 2.3. It provides much more efficient pickling of new-style classes. Refer to PEP 307 for information about improvements brought by protocol 2. This is most likely the protocol used in the original serialization

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

 

Related content

dbm error in lc10

Dbm Error In Lc p MaxDBWhere is this place located All Places SAP MaxDB Reply Latest reply May relatedl PM by Natalia Khlopina Tweet DBM Error return code - in LC Administration in SCM System Live Cache Vaibhav Abhayankar May PM Currently Being Moderated Hello We have installed SCM on Solaris on one box and LC on another solaris box For kernel upgrade we shut down Live Cache using LC administration on SCM server After kernel patch other patches for ABAP stack we upgraded LC to SP build Since then we get following error in LC Name and Server LCA

dbm error

Dbm Error table id toc tbody tr td div id toctitle Contents div ul li a href Deadly Boss Mod a li li a href Curse Dbm a li ul td tr tbody table p AddOns Comps Macros Featured Projects Developer Site Forums Mark Forums Read relatedl Subscribed Threads Open Buddy List Members List Help wow dbm error Login Sign up WoWInterface raquo Featured Projects raquo RealUI raquo deadly boss mods error DBM Error Go to Page Reply View First Unread Thread Tools Display Modes - - dbm profiles PM soulesschild A Deviate Faerie Dragon Join Date Dec Posts DBM

dbm error 24964

Dbm Error p Sybase Support Portal SAP PartnerEdge SAP Training Certification Shop SAP Service Marketplace SAP Store Analytics Content and Collaboration Customer Relationship Mgmt relatedl Data Management Enterprise Management Financial Management Human Capital Management Product Lifecycle Mgmt Supplier Relationship Mgmt Supply Chain Management Technology Platform Additional Information bankingservices SAP MaxDB Library SAP MaxDB Library Installation Manual Database Administration SAP MaxDB Security Guide Concepts of the Database System Tools Interfaces Tutorials Reference Messages Number Ranges From - to - From - to - From - to - From - to - From - to - From - to - From -

dbm error 24941

Dbm Error p MaxDBWhere is this place located All Places SAP MaxDB Replies Latest reply Aug PM by Martin Winn Tweet MaxDB relatedl DB connection failed DB DB Dennis Gr ning Oct PM Currently Being Moderated Hello i have installed a new ERP SAP System on MaxDB Sles Linux After successful installation i have tested the database connection The database connection failed What could i do to solve the problem SAP transaction DB Test Result p P p SAP Kernel Release EXT RELSAP Kernel Patch DBMRFC Release DBMCLI Release DBSL Release DBSL Patch SQLDBC Version SQLDBC Runtime DBSL Library Availability

dbm error message

Dbm Error Message table id toc tbody tr td div id toctitle Contents div ul li a href Dbm Profiles a li li a href Deadly Boss Mod a li ul td tr tbody table p liveCache TechnologyWhere is this place located All Places Supply Chain Management SAP SCM SAP Advanced Planning Optimization SAP APO SAP liveCache Technology Replies Latest reply Aug PM by relatedl Martin Winn Tweet Error while opening LC Venkatachary Ravullapally Aug p h id Dbm Profiles p PM Currently Being Moderated Hi All We have installed live cache dbm disable cinematics SCM in the same system