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.framewor k/Versions/2.3/lib/
python2.3/shelve.py", line 231, in open
return DbfilenameShelf (filename, flag, protocol, writeback,
binary)
File "/System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/
python2.3/shelve.py", line 212, in __init__
Shelf.__init__( self, anydbm.open(fil ename, flag), protocol,
writeback, binary)
File "/System/Library/Frameworks/Python.framewor k/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.Attr ibuteError: "DbfilenameShel f instance has no
attribute 'writeback'" in ignored
---------------------
What should I do to correct that error?
--------------------
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.framewor k/Versions/2.3/lib/
python2.3/shelve.py", line 231, in open
return DbfilenameShelf (filename, flag, protocol, writeback,
binary)
File "/System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/
python2.3/shelve.py", line 212, in __init__
Shelf.__init__( self, anydbm.open(fil ename, flag), protocol,
writeback, binary)
File "/System/Library/Frameworks/Python.framewor k/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.Attr ibuteError: "DbfilenameShel f instance has no
attribute 'writeback'" in ignored
---------------------
What should I do to correct that error?
Comment