[Python-bugs-list] [ python-Bugs-731501 ] Importing anydbm generates exception if _bsddb unavailable

SourceForge.net noreply@sourceforge.net
Sat, 03 May 2003 02:02:50 -0700


Bugs item #731501, was opened at 2003-05-02 19:56
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=731501&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Nick Vargish (vargish)
Assigned to: Skip Montanaro (montanaro)
Summary: Importing anydbm generates exception if _bsddb unavailable

Initial Comment:
The anydbm module attempts to import the dbhash module,
which fails if there is no BSD DB module available.

Relevant portion of backtrace:

  File "/diska/netsite-docs/cgi-bin/waisdb2.py", line
124, in _getsystemsdbm
    dbsrc = anydbm.open(self.dbfile)
  File
"/usr/local/python-2.3b1/lib/python2.3/anydbm.py", line
82, in open
    mod = __import__(result)
  File
"/usr/local/python-2.3b1/lib/python2.3/dbhash.py", line
5, in ?
    import bsddb
  File
"/usr/local/python-2.3b1/lib/python2.3/bsddb/__init__.py",
line 40, in ?
    import _bsddb
ImportError: No module named _bsddb

Tests that explicitly use "import dbm" rather than
anydbm are successful on this system.


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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-05-03 11:02

Message:
Logged In: YES 
user_id=21627

I think this is not a bug. open() has determined that this
is a bsddb file, but bsddb is not supported on the system.

Or did you mean to suggest that opening the very same file
with dbm would be successful?

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

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