shelve error

mik3l3374 at gmail.com mik3l3374 at gmail.com
Thu Apr 5 06:22:46 CEST 2007


On Apr 5, 12:14 pm, "7stud" <bbxx789_0... at yahoo.com> wrote:
> test1.py:
> --------------------
> import shelve
>
> s = shelve.open("/Users/me/2testing/dir1/aaa.txt")
> s['x'] = "red"
> s.close()
> --------output:------
>
> $ python test1.py
> Traceback (most recent call last):
>   File "test1.py", line 3, in ?
>     s = shelve.open("/Users/me/2testing/dir1/aaa.txt")
>   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/shelve.py", line 231, in open
>     return DbfilenameShelf(filename, flag, protocol, writeback,
> binary)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/shelve.py", line 212, in __init__
>     Shelf.__init__(self, anydbm.open(filename, flag), protocol,
> writeback, binary)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/anydbm.py", line 80, in open
>     raise error, "db type could not be determined"
> anydbm.error: db type could not be determined
> Exception exceptions.AttributeError: "DbfilenameShelf instance has no
> attribute 'writeback'" in  ignored
> ---------------------
>
> What should I do to correct that error?

how did you generate aaa.txt?




More information about the Python-list mailing list