Commit 9066a142 authored by Hanno Schlichting's avatar Hanno Schlichting

Don't publish acquired attributes if acquired object has no docstring.

parent 537f6512
...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/. ...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed Bugs Fixed
++++++++++ ++++++++++
- LP #713253: Prevent publication of acquired attributes, where the acquired
object does not have a docstring.
- Fix `LazyMap` to avoid unnecessary function calls. - Fix `LazyMap` to avoid unnecessary function calls.
- LP 686664: WebDAV Lock Manager ZMI view wasn't accessible. - LP 686664: WebDAV Lock Manager ZMI view wasn't accessible.
......
...@@ -126,11 +126,11 @@ class DefaultPublishTraverse(object): ...@@ -126,11 +126,11 @@ class DefaultPublishTraverse(object):
# Again, clear any error status created by __bobo_traverse__ # Again, clear any error status created by __bobo_traverse__
# because we actually found something: # because we actually found something:
request.response.setStatus(200) request.response.setStatus(200)
return subobject
except AttributeError: except AttributeError:
pass pass
# Lastly we try with key access: # Lastly we try with key access:
if subobject is None:
try: try:
subobject = object[name] subobject = object[name]
except TypeError: # unsubscriptable except TypeError: # unsubscriptable
......
...@@ -335,6 +335,14 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory): ...@@ -335,6 +335,14 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
r = self._makeOne(root) r = self._makeOne(root)
self.assertRaises(NotFound, r.traverse, 'folder/objBasic/noview') self.assertRaises(NotFound, r.traverse, 'folder/objBasic/noview')
def test_traverse_acquired_attribute_without_docstring(self):
from ZPublisher import NotFound
root, folder = self._makeRootAndFolder()
root._setObject('objBasic',
self._makeObjectWithEmptyDocstring())
r = self._makeOne(root)
self.assertRaises(NotFound, r.traverse, 'folder/objBasic')
def test_traverse_class_without_docstring(self): def test_traverse_class_without_docstring(self):
from ZPublisher import NotFound from ZPublisher import NotFound
root, folder = self._makeRootAndFolder() root, folder = self._makeRootAndFolder()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment