"ZPublisher.BaseRequest.BaseRequest.traverse" expects "has_key"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Lennart Regebro |
Bug Description
The following code in "ZPublisher.
# Note - no_acquire_flag is necessary to support
# things like DAV. We have to make sure
# that the target object is not acquired
# if the request_method is other than GET
# or POST. Otherwise, you could never use
# PUT to add a new object named 'test' if
# an object 'test' existed above it in the
# heirarchy -- you'd always get the
# existing object :(
if (no_acquire_flag and
not hasattr(
if not (hasattr(
Apparently, it tries to verify that "entry_name" was not acquired. Unfortunately, it expects "parents[1]" to implement a
"has_key" and that is rarely the case. Moreover: meanwhile "entry_name" can also be located with Zope3 means
and not only with attribute access (taken care of by the "hasattr") and subscription access (failed trial to handle
this with the "has_key").
Thus, the code above needs a significant overhaul.
Something for you, Lennard?