[ZCM] [ZC] 892/ 4 Assign "BTrees: misleading TypeError message"
Collector: Zope Bugs, Features, and Patches ...
zope-coders-admin@zope.org
Sun, 11 May 2003 20:24:50 -0400
Issue #892 Update (Assign) "BTrees: misleading TypeError message"
Status Accepted, Zope/bug medium
To followup, visit:
http://collector.zope.org/Zope/892
==============================================================
= Assign - Entry #4 by tim_one on May 11, 2003 8:24 pm
Status: Pending => Accepted
Supporters added: tim_one
Assigned to me. This was fixed in Zope3/ZODB4 as a side effect of generalizing BTree constructors to play nice with Python 2.2's new iterator protocol. The Zope2/ZODB3 code is clearly wrong in this case.
________________________________________
= Comment - Entry #3 by stevea on Apr 28, 2003 5:04 am
In the Zope 3 version, I get this:
>>> from zodb.btrees.OIBTree import OIBTree
>>> OIBTree({'x':1.2})
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: expected integer value
>>>
________________________________________
= Comment - Entry #2 by ajung on Apr 27, 2003 11:44 am
The submission was from me (forgot to login).
________________________________________
= Request - Entry #1 by Anonymous User on Apr 27, 2003 11:40 am
from BTrees.OIBTree import OIBTree
print OIBTree( {'a': 1.0} )
raises TypeError, "Sequence must contain 2-item tuples"
The explanation is wrong since this exception is raised by passing a float instead of an int.
==============================================================