This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: bsddb: bug with 'n' flag
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: akuchling, gregory.p.smith, mmokrejs
Priority: normal Keywords:

Created on 2005-02-22 22:14 by mmokrejs, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg24362 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2005-02-22 22:14

You say there:
btopen(  	filename[, flag[, mode[, btflags[,
cachesize[, maxkeypage[, minkeypage[, psize[,

the word psize should be replaced with pgsize.

An example would help:
>>> d = bsddb.btopen(None, "c", cachesize=768000,
>>> d = bsddb.btopen(None, "n", cachesize=768000,
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/bsddb/", line
201, in btopen
    flags = _checkflag(flag, file)
  File "/usr/lib/python2.3/bsddb/", line
249, in _checkflag
    if os.path.isfile(file):
  File "/usr/lib/python2.3/", line 200, in
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer,
NoneType found

The latter is I believe possibly a bug in the python
wrapper not handling 'n' properly. 
msg24363 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2005-06-08 21:57
Logged In: YES 

I've fixed the documentation to use the right parameter
name; thanks for reporting this!

The example you give doesn't work for me: it reports
'bsddb._db.DBInvalidArgError: (22, 'Invalid argument --
set_cachesize: method meaningless in shared environment')'
with the current CVS head.  Removing the cachesize argument
makes it work.

The 'n' problem does seem to be a bug; the code should check
that file is not None before doing os.file.exists(). 
Reassigning and reclassifying the bug.
msg24364 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2006-04-12 20:17
Logged In: YES 

fix for the 'n' flag not working with a filename of None
committed (with a test case).  svn rev 45318.
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41615
2005-02-22 22:14:20mmokrejscreate