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: gdbm.open () fails with a single argument
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, roysmith
Priority: normal Keywords:

Created on 2004-06-30 15:29 by roysmith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21361 - (view) Author: Roy Smith (roysmith) Date: 2004-06-30 15:29
I am running:

Python 2.3.4 (#3, Jun 29 2004, 21:48:03) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin

Darwin Roy-Smiths-Computer.local 7.4.0 Darwin Kernel Version 
7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu
-517.7.7.obj~7/RELEASE_PPC  Power Macintosh powerpc

release 1.8.3 of GNU dbm.

I've got a readable gdbm file:
-rw-r--r--  1 roy  roy  12288 30 Jun 09:52 status.gdbm

If I try to open it with no flag argument, it fails.  Explicitly 
specifying 'r' as a 2nd argument works.

>>> import gdbm
>>> gdbm.open ('status.gdbm')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
gdbm.error: Flag ' ' is not supported.
>>> gdbm.open ('status.gdbm', 'r')
<gdbm.gdbm object at 0x354050>

The on-line doc says the 2nd argument is optional:
http://www.python.org/doc/current/lib/module-gdbm.html

It's not clear if it's the code or the doc that wrong.
msg21362 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-07-07 14:22
Logged In: YES 
user_id=11375

The code is wrong.  The bug is fixed by patch #984672 by
James Lamanna, which has been applied to CVS and the 2.3 branch.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40484
2004-06-30 15:29:16roysmithcreate