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
3f7bc9df
Commit
3f7bc9df
authored
Jun 29, 2007
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged 2.10 branch r77227:77228 into the trunk.
The REQUEST should not accept holds after it has been closed.
parent
138c0785
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-1
lib/python/ZPublisher/BaseRequest.py
lib/python/ZPublisher/BaseRequest.py
+2
-1
lib/python/ZPublisher/tests/testBaseRequest.py
lib/python/ZPublisher/tests/testBaseRequest.py
+11
-0
No files found.
doc/CHANGES.txt
View file @
3f7bc9df
...
...
@@ -102,7 +102,8 @@ Zope Changes
Bugs Fixed
<<<<<<< .working
- The REQUEST no longer accepts holds after it has been closed.
- Five.browser.metaconfigure.page didn't protect names from interface
superclasses (http://www.zope.org/Collectors/Zope/2333)
...
...
lib/python/ZPublisher/BaseRequest.py
View file @
3f7bc9df
...
...
@@ -634,6 +634,7 @@ class BaseRequest:
def
_hold
(
self
,
object
):
"""Hold a reference to an object to delay it's destruction until mine
"""
if
self
.
_held
is
not
None
:
self
.
_held
=
self
.
_held
+
(
object
,)
def
exec_callables
(
callables
):
...
...
lib/python/ZPublisher/tests/testBaseRequest.py
View file @
3f7bc9df
...
...
@@ -247,6 +247,17 @@ class TestBaseRequest(TestCase):
self
.
assertRaises
(
NotFound
,
r
.
traverse
,
'folder/simpleSet'
)
self
.
assertRaises
(
NotFound
,
r
.
traverse
,
'folder/simpleFrozenSet'
)
def
test_hold_after_close
(
self
):
# Request should no longer accept holds after it has been closed
r
=
self
.
makeBaseRequest
()
r
.
_hold
(
lambda
x
:
None
)
self
.
assertEqual
(
len
(
r
.
_held
),
1
)
r
.
close
()
# No more holding from now on
self
.
assertEqual
(
r
.
_held
,
None
)
r
.
_hold
(
lambda
x
:
None
)
self
.
assertEqual
(
r
.
_held
,
None
)
from
ZPublisher
import
NotFound
import
zope.interface
...
...
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