SimpleItem's getId implementation is prone to infinite recursion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Unassigned |
Bug Description
In SimpleItem, we have the following::
security.
def getId(self):
"""Return the id of the object as a string.
This method should be used in preference to accessing an id attribute
of an object directly. The getId method is public.
"""
if callable(name):
return name()
if name is not None:
return name
if hasattr(self, '__name__'):
return self.__name__
raise AttributeError, 'This object has no id'
# Alias id to __name__, which will make tracebacks a good bit nicer:
__name_
If self.id isn't set or is None, and __name__ has not been set or overridden, this will always result in infinite recursion. self.getId() calls self.__name__ which calls self.getId().
Changed in zope2: | |
importance: | Undecided → Low |
Changed in zope2: | |
status: | New → Confirmed |
I can not reproduce this error. Unittest?