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.

classification
Title: dbm.open(..., "x")
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, Claudiu.Popa, berker.peksag, serhiy.storchaka
Priority: normal Keywords:

Created on 2014-11-28 22:42 by Antony.Lee, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg231835 - (view) Author: Antony Lee (Antony.Lee) * Date: 2014-11-28 22:42
It would be nice if dbm.open() supported the "x" flag that open() now supports (create a new db, failing if it already exists).
msg342280 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-05-13 02:35
Python directly passes flags to gdbm (or whatever the dbm interface is). 

gdbm_open((char *)file, 0, flags, mode, NULL)) # _gdbmmodule.c:76

I dont think it is good idea to wrap gdbm for just a flag.
msg350102 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-08-21 19:24
Agree with Batuhan. There are three dbm implementations in the stdlib: dumb, ndbm and gnu. It may be possible to implement the "x" flag in the former two, but gdbm_open() does not support it.

Since by default the implementation is chosen automatically in dbm.open(), I do not think it is practically to implement a flag which do not work with all implementations.
History
Date User Action Args
2022-04-11 14:58:10adminsetgithub: 67153
2019-08-21 19:24:49serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg350102

resolution: rejected
stage: needs patch -> resolved
2019-05-13 05:33:52Antony.Leesetnosy: - Antony.Lee
2019-05-13 02:35:25BTaskayasetnosy: + BTaskaya
messages: + msg342280
2015-03-09 14:59:15Claudiu.Popasetnosy: + Claudiu.Popa
2014-11-28 22:53:18berker.peksagsetnosy: + berker.peksag
stage: needs patch
type: enhancement

versions: + Python 3.5, - Python 3.4
2014-11-28 22:42:31Antony.Leecreate