私は macports から python 3.1.4 を実行しており、ここで shelve モジュールを使用しようとしています。別の開発者で正常に使用できます。マシン(異なるOSなど)なので、何が間違っているのかわかりません...
どんな考えや提案も大歓迎です!
これがエラー「dbm.error: db type could not be defined」です (エラーメッセージを検索しましたが、情報が見つかりませんでした - protocl=2 を強制して、それが役立つかどうかを確認しようとしましたが、そうではありませんでした)
インタラクティブなセッションは次のとおりです。
Python 3.1.4 (default, Oct 7 2011, 15:58:53)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>>> import shelve
>>> a = [1, 2, 3]
>>> locker = shelve.open('myshelf',protocol=2)
>>> locker['a'] = a
>>> locker.close()
>>> exit()
Python 3.1.4 (default, Oct 7 2011, 15:58:53)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>>> import shelve
>>> locker = shelve.open('myshelf',protocol=2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/shelve.py", line 231, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/shelve.py", line 215, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/dbm/__init__.py", line 84, in open
raise error[0]("db type could not be determined")
dbm.error: db type could not be determined