My code looks as follows:
Expand|Select|Wrap|Line Numbers
- from bsddb import db
- from os import mkdir
- from os.path import exists
- homeDir = 'pidgindb'
- db_env = db.DBEnv()
- db_env.set_cachesize(0, 1024*1024*50)
- if not exists(homeDir):
- homeDir = mkdir(homeDir)
- db_env.open(homeDir, db.DB_INIT_MPOOL|db.DB_CREATE)
- pidgin = db.DB(db_env)
- pidgin.open('pidgin',None,db.DB_BTREE,db.DB_CREATE,0660)
- pidgin['apple'] = 'fruit'
- pidgin['carrot'] = 'vegetable'
- pidgin.close()
, __db.002, pidgin) in the current directory. When I run it for the second time, it behaves correctly and creates the database files in the dir specified while opening DBEnv. Is this a bug, or am I doing something wrong?
My environment: Windows, Python 2.4.3, bsddb 4.3.0.1
Thanks!