搁置错误 [英] shelve error

查看:54
本文介绍了搁置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

test1.py:

--------------------

进口货架


s = shelve.open(" /Users/me/2testing/dir1/aaa.txt")

s [''x''] =" red"

s.close()

--------输出:------


$ python test1 .py

回溯(最近一次调用最后一次):

文件" test1.py",第3行,在?

s = shelve。 open(&Users/me/2testing/dir1/aaa.txt")

File" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2.3 / shelve.py",第231行,打开

返回DbfilenameShelf(文件名,标志,协议,写回,

二进制)

文件" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2.3 / shelve.py",第212行,在__init __
Shelf .__ init __(self,anydbm.open(filename,flag),protocol,

writeback,binary)

File" / System / Library /框架/ Python.framework / VERSI ons / 2.3 / lib /

python2.3 / anydbm.py",第80行,打开

引发错误,db type无法确定

anydbm.error:无法确定db类型

异常exception.AttributeError:DbfilenameShelf实例没有

属性''writeback'' ;被忽略了

---------------------


我该怎么做才能纠正这个问题错误?

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?

推荐答案

python test1.py

回溯(最近一次调用最后一次):

文件" test1.py",第3行,在?

s = shelve.open(" /Users/me/2testing/dir1/aaa.txt")

文件" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2.3 / shelve.py",第231行,打开

返回DbfilenameShelf(文件名,标志,协议,写回,

二进制)

文件" /System/Library/Frameworks/Python.framework/Versions/ 2.3 / lib /

python2.3 / shelve.py",第212行,在__init__

Shelf .__ init __(self,anydbm.open(filename,flag),protocol ,

回写,二进制)

文件" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2 .3 / anydbm.py",第80行,打开

引发错误,db t ype无法确定

anydbm.error:无法确定db类型

异常exception.AttributeError:" DbfilenameShelf实例没有

属性''writeback''"被忽略了

---------------------


我该怎么做才能纠正这个问题错误?

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?


4月5日下午12:14,7stud < bbxx789_0 ... @ yahoo.comwrote:
On Apr 5, 12:14 pm, "7stud" <bbxx789_0...@yahoo.comwrote:

test1.py:

----------- ---------

进口货架

s = shelve.open(" /Users/me/2testing/dir1/aaa.txt" ;)

s [''x''] =" red"

s.close()

------- -output:------

test1.py:
--------------------
import shelve

s = shelve.open("/Users/me/2testing/dir1/aaa.txt")
s[''x''] = "red"
s.close()
--------output:------


python test1.py

Traceback(最近一次调用最后一次):

文件" test1.py",第3行,在?

s = shelve.open(" /Users/me/2testing/dir1/aaa.txt")

文件" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2.3 / shelve.py",第231行,打开

返回DbfilenameShelf(filename,flag,protocol,writeback,

binary)

File" /System/Library/Frameworks/Python.framework/Versions /2.3/lib/

python2.3 / shelve.py",第212行,在__init__

Shelf .__ init __(self,anydbm.open(filename,f滞后),协议,

回写,二进制)

文件" /System/Library/Frameworks/Python.framework/Versions/2.3/lib/

python2.3 / anydbm.py",第80行,打开

引发错误,db type无法确定

anydbm.error:db无法确定类型

异常exception.AttributeError:DbfilenameShelf实例没有

属性''writeback''"被忽略了

---------------------


我该怎么做才能纠正这个问题错误?
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?



你是如何生成aaa.txt的?

how did you generate aaa.txt?


这篇关于搁置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆