Message99667
| Author |
adam-collard |
| Recipients |
adam-collard |
| Date |
2010年02月21日.15:44:15 |
| SpamBayes Score |
1.0869011e-08 |
| Marked as misclassified |
No |
| Message-id |
<1266767057.06.0.0487468056966.issue7975@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Originally reported at:
https://bugs.edge.launchpad.net/bugs/384602
In Python 2.6, the dbshelve.py module throws an AttributeError exception whenever a call is made to a method that depends upon an __iter__ method. The exception is:
File "/usr/lib/python2.6/bsddb/dbshelve.py", line 167, in __iter__
return self.db.__iter__()
AttributeError: 'DB' object has no attribute '__iter__'
This means that, if mydb is an istance of a DB object, the following examples will fail:
for key in mydb: print key
print (k for k in mydb.iterkeys())
for k, d in mydb.itervalues(): print k, d
and many other statements depending on iterable(mydb) being true
Note that, in Python 2.5, these examples work and no exception is thrown. In fact, if you have both 2.5 and 2.6 installed on the same system, you can run the same program containing code as above with Python2.5 without issue while running it under Python 2.6 raises the exception seen above. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年02月21日 15:44:17 | adam-collard | set | recipients:
+ adam-collard |
| 2010年02月21日 15:44:17 | adam-collard | set | messageid: <1266767057.06.0.0487468056966.issue7975@psf.upfronthosting.co.za> |
| 2010年02月21日 15:44:15 | adam-collard | link | issue7975 messages |
| 2010年02月21日 15:44:15 | adam-collard | create |
|