[ZCM] [ZC] 1777/ 6 Comment "ExtensionClass delattr raises KeyError"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Thu May 12 11:12:55 EDT 2005
Issue #1777 Update (Comment) "ExtensionClass delattr raises KeyError"
Status Accepted, Zope/bug low
To followup, visit:
http://www.zope.org/Collectors/Zope/1777
==============================================================
= Comment - Entry #6 by tseaver on May 12, 2005 11:12 am
The issue appears to disappear in 2.8, because ExtensionClass loses
lots of its special behavior::
[/home/tseaver/projects/Zope-CVS/Zope-SVN-trunk/instance]
$ bin/zopectl run collector_1777.py
Traceback (most recent call last):
File "collector_1777.py", line 11, in ?
del foo.nonesuch
AttributeError: 'Foo' object has no attribute 'nonesuch'
Traceback (most recent call last):
File "collector_1777.py", line 21, in ?
del bar.nonesuch
AttributeError: 'Bar' object has no attribute 'nonesuch'
________________________________________
= Comment - Entry #5 by tseaver on May 12, 2005 8:13 am
Uploaded: "collector_1777-no_help.patch"
- http://www.zope.org/Collectors/Zope/1777/collector_1777-no_help.patch/view
Attaching a patch to ExtensionClass.c which *does not* fix the
problem, although it does attempt to address all cases where
'PyDict_DelItem' and 'PyDict_DelItemString' are called.
Beats the heck out of me how I can still be getting KeyErrors,
but I do.
________________________________________
= Comment - Entry #4 by tseaver on May 12, 2005 8:06 am
Uploaded: "collector_1777.py"
- http://www.zope.org/Collectors/Zope/1777/collector_1777.py/view
Attaching a script which shows the bug against ExtensionClass.Base,
too.
________________________________________
= Assign - Entry #3 by tseaver on May 11, 2005 6:35 pm
Supporters added: jim; removed: tim_one
________________________________________
= Comment - Entry #2 by tim_one on May 11, 2005 5:31 pm
The chance that I can make time to look at this in ZODB 3.2 is approximately 0%.
ExtensionClass isn't part of ZODB 3.4, so the chance that I'll look at this in Zope 2.8 is something less than 0% <0.4 wink>.
________________________________________
= Request - Entry #1 by tseaver on May 11, 2005 4:58 pm
Status: Pending => Accepted
Supporters added: tim_one
The two setattr implementations in ExtensionClass.c
('subclass_simple_setattro' and 'subclass_simple_setattr')
don't check / convert errors returned by PyDict_DelItem, leading to::
>>> from Persistence import Persistent
>>> class Foo(Persistent):
... pass
...
>>> foo = Foo()
>>> del foo.nonesuch
Traceback (most recent call last):
File "<stdin>", line 1, in ?
KeyError: 'nonesuch'
==============================================================
More information about the Zope-Collector-Monitor
mailing list