7
7stud
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
--------------------
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