Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2458a7fa
Commit
2458a7fa
authored
Feb 06, 2011
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't publish acquired attributes if acquired object has no docstring.
See
https://bugs.launchpad.net/zope2/+bug/713253/
parent
3bd76737
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
9 deletions
+18
-9
doc/CHANGES.rst
doc/CHANGES.rst
+4
-1
setup.py
setup.py
+1
-1
src/ZPublisher/BaseRequest.py
src/ZPublisher/BaseRequest.py
+5
-7
src/ZPublisher/tests/testBaseRequest.py
src/ZPublisher/tests/testBaseRequest.py
+8
-0
No files found.
doc/CHANGES.rst
View file @
2458a7fa
...
@@ -5,12 +5,15 @@ This file contains change information for the current Zope release.
...
@@ -5,12 +5,15 @@ This file contains change information for the current Zope release.
Change information for previous versions of Zope can be found at
Change information for previous versions of Zope can be found at
http://docs.zope.org/zope2/releases/.
http://docs.zope.org/zope2/releases/.
2.12.15 (
unreleased
)
2.12.15 (
2011-02-04
)
--------------------
--------------------
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.
2.12.14 (2010-12-07)
2.12.14 (2010-12-07)
...
...
setup.py
View file @
2458a7fa
...
@@ -16,7 +16,7 @@ import os
...
@@ -16,7 +16,7 @@ import os
from
setuptools
import
setup
,
find_packages
,
Extension
from
setuptools
import
setup
,
find_packages
,
Extension
setup
(
name
=
'Zope2'
,
setup
(
name
=
'Zope2'
,
version
=
'2.12.15
dev
'
,
version
=
'2.12.15'
,
url
=
'http://www.zope.org'
,
url
=
'http://www.zope.org'
,
license
=
'ZPL 2.1'
,
license
=
'ZPL 2.1'
,
description
=
'Zope2 application server / web framework'
,
description
=
'Zope2 application server / web framework'
,
...
...
src/ZPublisher/BaseRequest.py
View file @
2458a7fa
...
@@ -120,23 +120,21 @@ class DefaultPublishTraverse(object):
...
@@ -120,23 +120,21 @@ 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:
try
:
if
subobject
is
None
:
subobject
=
object
[
name
]
try
:
except
TypeError
:
# unsubscriptable
subobject
=
object
[
name
]
raise
KeyError
(
name
)
except
TypeError
:
# unsubscriptable
raise
KeyError
(
name
)
# Ensure that the object has a docstring, or that the parent
# Ensure that the object has a docstring, or that the parent
# object has a pseudo-docstring for the object. Objects that
# object has a pseudo-docstring for the object. Objects that
# have an empty or missing docstring are not published.
# have an empty or missing docstring are not published.
doc
=
getattr
(
subobject
,
'__doc__'
,
None
)
doc
=
getattr
(
subobject
,
'__doc__'
,
None
)
if
doc
is
None
:
doc
=
getattr
(
object
,
'%s__doc__'
%
name
,
None
)
if
not
doc
:
if
not
doc
:
raise
Forbidden
(
raise
Forbidden
(
"The object at %s has an empty or missing "
\
"The object at %s has an empty or missing "
\
...
...
src/ZPublisher/tests/testBaseRequest.py
View file @
2458a7fa
...
@@ -304,6 +304,14 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
...
@@ -304,6 +304,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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment