Issue 22964: dbm.open(..., "x") - Python tracker (original) (raw)

Issue22964

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:10 admin set github: 67153
2019-08-21 19:24:49 serhiy.storchaka set status: open -> closednosy: + serhiy.storchakamessages: + resolution: rejectedstage: needs patch -> resolved
2019-05-13 05:33:52 Antony.Lee set nosy: - Antony.Lee
2019-05-13 02:35:25 BTaskaya set nosy: + BTaskayamessages: +
2015-03-09 14:59:15 Claudiu.Popa set nosy: + Claudiu.Popa
2014-11-28 22:53:18 berker.peksag set nosy: + berker.peksagstage: needs patchtype: enhancementversions: + Python 3.5, - Python 3.4
2014-11-28 22:42:31 Antony.Lee create