[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-03-18 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

This bug was introduced in pybsddb 4.7.2, when migration to ABC (Abstract Base 
Classes).

I have solved it in 4.8.3+, and added relevant testcases.

I plan to integrate 4.8.3+ in Python 2.7. See issue8156.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-23 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Committed to trunk in r78412 and 2.6 in r78413.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-22 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

+1

--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-21 Thread Adam Collard

New submission from Adam Collard adam.coll...@gmail.com:

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.

--
messages: 99667
nosy: adam-collard
severity: normal
status: open
title: dbshelve.py throws exception: AttributeError: 'DB' object has no 
attribute '__iter__'

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-21 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Could you please provide a complete example that demonstrates the problem?  A 
naive example using shelve with a dbhash database seems to work fine.

--
nosy: +r.david.murray
priority:  - normal
stage:  - test needed
type:  - behavior
versions: +Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-21 Thread Adam Collard

Adam Collard adam.coll...@gmail.com added the comment:

Attached a simple example.

--
Added file: http://bugs.python.org/file16280/dbshelve_example.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-21 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The bug seems to have been introduced by an incomplete or incorrect translation 
to the newer idiom (DictMixin to MutableMapping).  Since bsddb is gone in py3, 
I'm inclined to fix it by just going back to using DictMixin.  There are no 
tests for the DictMixin functionality added in Python 2.3.

--
components: +Library (Lib)
keywords: +easy
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-21 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Here's a patch.  test_bsddb3 still passes with this patch applied on trunk.

--
assignee:  - r.david.murray
keywords: +patch
stage: test needed - patch review
Added file: http://bugs.python.org/file16284/dbshelve_dictmixin.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com