Issue 982806: gdbm.open () fails with a single argument (original) (raw)
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 "", 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.