[pybsddb] bsddb.db.DBNoSuchFileError on DBEnv.open

lasizoillo lasizoillo at gmail.com
Sun Aug 29 19:37:31 CEST 2010


2010/8/29 solsTiCe d'Hiver <solstice.dhiver at gmail.com>:
> hi.
> First issue
> ================
> I am trying to open (create) a new environment with
>
> from bsddb import db
> env = db.DBEnv(db.DB_CREATE|db.DB_INIT_MPOOL)
> env.open('.db4')
>
> and this fails with:
> Traceback (most recent call last):
>  File "t.py", line 3, in <module>
>    env.open('.db4')
> bsddb.db.DBNoSuchFileError: (2, 'No such file or directory')
>

There are various places for flags:
 * env = db.DBEnv(flags=0) is not used for now. Only historical
reason, not used now. [1]
 * env.set_flags() for enviroment flags [2]
 * db = env.open(file, flags=myflags) for open a database [3]


[1] http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/envcreate.html
[2] http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/envset_flags.html
[3] http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/envopen.html

Your are putting flags in wrong place. See test for functional examples:
http://hg.jcea.es/pybsddb/file/d75e1f6dac64/Lib/bsddb/test/test_dbenv.py


> Second Issue
> ================
> also in the doc, DBEnv() is said to accept flags keyword but in effect
> you can't use it because you get TypeError: DBEnv() takes no keyword
> arguments
> so either the doc is incorrect
> http://www.jcea.es/programacion/pybsddb_doc/dbenv.html#dbenv-methods
> or the implementation is wrong
>
> also DBEnv.open() is also said to accept flags keyword but you get the
> same error if you use flags keyword
>
>

Can you pass the berkeley db tests?
Can you confirm the issues in docs with oracle docs? Oracle breaks
links frecuently :-(

Berkeley DB is hard to learn. I have been a lot of issues (at start
mostly). But all I remember was my fault ;-)

Programer's Reference is a great start point for understand the system
complexity:
http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/index.html

Excuse my poor english. I hope to be helpful.

Regards,

Javi


More information about the pybsddb mailing list