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
b670bb7e
Commit
b670bb7e
authored
Sep 18, 2009
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport r104360 from trunk: do not emit the request closed event from a request clone
parent
9c125a91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
6 deletions
+30
-6
doc/CHANGES.txt
doc/CHANGES.txt
+7
-0
lib/python/ZPublisher/BaseRequest.py
lib/python/ZPublisher/BaseRequest.py
+5
-2
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+4
-4
lib/python/ZPublisher/tests/testHTTPRequest.py
lib/python/ZPublisher/tests/testHTTPRequest.py
+14
-0
No files found.
doc/CHANGES.txt
View file @
b670bb7e
...
@@ -4,6 +4,13 @@ Zope Changes
...
@@ -4,6 +4,13 @@ Zope Changes
Change information for previous versions of Zope can be found in the
Change information for previous versions of Zope can be found in the
file HISTORY.txt.
file HISTORY.txt.
Zope 2.11.5 (Unreleased)
Bugs Fixed
- LP #414757 (backported from Zope trunk): don't emit a IEndRequestEvent
when clearing a cloned request.
Zope 2.11.4 (2009/08/06)
Zope 2.11.4 (2009/08/06)
Restructuring
Restructuring
...
...
lib/python/ZPublisher/BaseRequest.py
View file @
b670bb7e
...
@@ -203,11 +203,14 @@ class BaseRequest:
...
@@ -203,11 +203,14 @@ class BaseRequest:
else
:
other
.
update
(
kw
)
else
:
other
.
update
(
kw
)
self
.
other
=
other
self
.
other
=
other
def
cl
ose
(
self
):
def
cl
ear
(
self
):
self
.
other
.
clear
()
self
.
other
.
clear
()
notify
(
EndRequestEvent
(
None
,
self
))
self
.
_held
=
None
self
.
_held
=
None
def
close
(
self
):
self
.
clear
()
notify
(
EndRequestEvent
(
None
,
self
))
def
processInputs
(
self
):
def
processInputs
(
self
):
"""Do any input processing that could raise errors
"""Do any input processing that could raise errors
"""
"""
...
...
lib/python/ZPublisher/HTTPRequest.py
View file @
b670bb7e
...
@@ -149,7 +149,7 @@ class HTTPRequest(BaseRequest):
...
@@ -149,7 +149,7 @@ class HTTPRequest(BaseRequest):
r
.
retry_count
=
self
.
retry_count
r
.
retry_count
=
self
.
retry_count
return
r
return
r
def
cl
ose
(
self
):
def
cl
ear
(
self
):
# Clear all references to the input stream, possibly
# Clear all references to the input stream, possibly
# removing tempfiles.
# removing tempfiles.
self
.
stdin
=
None
self
.
stdin
=
None
...
@@ -159,7 +159,7 @@ class HTTPRequest(BaseRequest):
...
@@ -159,7 +159,7 @@ class HTTPRequest(BaseRequest):
# one. Without this, there's the possibility of memory leaking
# one. Without this, there's the possibility of memory leaking
# after every request.
# after every request.
self
.
_lazies
=
{}
self
.
_lazies
=
{}
BaseRequest
.
cl
ose
(
self
)
BaseRequest
.
cl
ear
(
self
)
def
setServerURL
(
self
,
protocol
=
None
,
hostname
=
None
,
port
=
None
):
def
setServerURL
(
self
,
protocol
=
None
,
hostname
=
None
,
port
=
None
):
""" Set the parts of generated URLs. """
""" Set the parts of generated URLs. """
...
@@ -1082,7 +1082,7 @@ class HTTPRequest(BaseRequest):
...
@@ -1082,7 +1082,7 @@ class HTTPRequest(BaseRequest):
try
:
object
=
req
.
traverse
(
path
)
try
:
object
=
req
.
traverse
(
path
)
except
:
rsp
.
exception
()
except
:
rsp
.
exception
()
if
object
is
None
:
if
object
is
None
:
req
.
cl
ose
()
req
.
cl
ear
()
raise
rsp
.
errmsg
,
sys
.
exc_info
()[
1
]
raise
rsp
.
errmsg
,
sys
.
exc_info
()[
1
]
# The traversal machinery may return a "default object"
# The traversal machinery may return a "default object"
...
@@ -1100,7 +1100,7 @@ class HTTPRequest(BaseRequest):
...
@@ -1100,7 +1100,7 @@ class HTTPRequest(BaseRequest):
if
name
!=
os
.
path
.
split
(
path
)[
-
1
]:
if
name
!=
os
.
path
.
split
(
path
)[
-
1
]:
object
=
req
.
PARENTS
[
0
]
object
=
req
.
PARENTS
[
0
]
req
.
cl
ose
()
req
.
cl
ear
()
return
object
return
object
...
...
lib/python/ZPublisher/tests/testHTTPRequest.py
View file @
b670bb7e
...
@@ -75,6 +75,20 @@ class AuthCredentialsTests( unittest.TestCase ):
...
@@ -75,6 +75,20 @@ class AuthCredentialsTests( unittest.TestCase ):
self
.
assertEqual
(
user_id_x
,
user_id
)
self
.
assertEqual
(
user_id_x
,
user_id
)
self
.
assertEqual
(
password_x
,
password
)
self
.
assertEqual
(
password_x
,
password
)
def
test_resolve_url_doesnt_send_endrequestevent
(
self
):
import
zope.event
events
=
[]
zope
.
event
.
subscribers
.
append
(
events
.
append
)
request
=
self
.
_makeOne
()
request
[
'PARENTS'
]
=
[
object
()]
try
:
request
.
resolve_url
(
request
.
script
+
'/'
)
finally
:
zope
.
event
.
subscribers
.
remove
(
events
.
append
)
self
.
failIf
(
len
(
events
),
"HTTPRequest.resolve_url should not emit events"
)
class
RecordTests
(
unittest
.
TestCase
):
class
RecordTests
(
unittest
.
TestCase
):
def
test_repr
(
self
):
def
test_repr
(
self
):
...
...
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