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
7e7c3397
Commit
7e7c3397
authored
Jun 17, 2010
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed ancient backwards compatibility code
parent
f983b270
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
36 deletions
+18
-36
doc/CHANGES.rst
doc/CHANGES.rst
+4
-0
src/Zope2/App/startup.py
src/Zope2/App/startup.py
+14
-19
src/Zope2/App/tests/testExceptionHook.py
src/Zope2/App/tests/testExceptionHook.py
+0
-17
No files found.
doc/CHANGES.rst
View file @
7e7c3397
...
...
@@ -11,6 +11,10 @@ Trunk (unreleased)
Restructuring
+++++++++++++
-
ZPublisherExceptionHook
:
Removed
ancient
backwards
compatibility
code
.
Customized
raise_standardErrorMessage
methods
have
to
implement
the
signature
introduced
in
Zope
2.6
.
-
Testing
:
Functional
.
publish
now
uses
the
real
publish_module
function
instead
of
that
from
ZPublisher
.
Test
.
The
'extra'
argument
of
the
publish
method
is
no
longer
supported
.
...
...
src/Zope2/App/startup.py
View file @
7e7c3397
...
...
@@ -263,25 +263,20 @@ class ZPublisherExceptionHook:
if
REQUEST
.
get
(
'AUTHENTICATED_USER'
,
None
)
is
None
:
REQUEST
[
'AUTHENTICATED_USER'
]
=
AccessControl
.
User
.
nobody
try
:
result
=
f
(
client
,
REQUEST
,
t
,
v
,
traceback
,
error_log_url
=
error_log_url
)
if
result
is
not
None
:
t
,
v
,
traceback
=
result
if
issubclass
(
t
,
Unauthorized
):
# Re-raise Unauthorized to make sure it is handled
# correctly. We can't do that with all exceptions
# because some don't work with the rendered v as
# argument.
raise
t
,
v
,
traceback
response
=
REQUEST
.
RESPONSE
response
.
setStatus
(
t
)
response
.
setBody
(
v
)
return
response
except
TypeError
:
# BBB: Pre Zope 2.6 call signature
f
(
client
,
REQUEST
,
t
,
v
,
traceback
)
result
=
f
(
client
,
REQUEST
,
t
,
v
,
traceback
,
error_log_url
=
error_log_url
)
if
result
is
not
None
:
t
,
v
,
traceback
=
result
if
issubclass
(
t
,
Unauthorized
):
# Re-raise Unauthorized to make sure it is handled
# correctly. We can't do that with all exceptions
# because some don't work with the rendered v as
# argument.
raise
t
,
v
,
traceback
response
=
REQUEST
.
RESPONSE
response
.
setStatus
(
t
)
response
.
setBody
(
v
)
return
response
finally
:
traceback
=
None
...
...
src/Zope2/App/tests/testExceptionHook.py
View file @
7e7c3397
...
...
@@ -225,12 +225,6 @@ class Client(Acquisition.Explicit):
def
dummyMethod
(
self
):
return
'Aye'
class
OldClient
(
Client
):
def
raise_standardErrorMessage
(
self
,
c
,
r
,
t
,
v
,
tb
):
from
zExceptions.ExceptionFormatter
import
format_exception
self
.
messages
.
append
(
''
.
join
(
format_exception
(
t
,
v
,
tb
,
as_html
=
0
)))
class
StandardClient
(
Client
):
def
raise_standardErrorMessage
(
self
,
c
,
r
,
t
,
v
,
tb
,
error_log_url
):
...
...
@@ -245,17 +239,6 @@ class BrokenClient(Client):
class
ExceptionMessageRenderTest
(
ExceptionHookTestCase
):
def
testRenderUnauthorizedOldClient
(
self
):
from
AccessControl
import
Unauthorized
def
f
():
raise
Unauthorized
,
1
request
=
self
.
_makeRequest
()
client
=
OldClient
()
self
.
call
(
client
,
request
,
f
)
self
.
failUnless
(
client
.
messages
,
client
.
messages
)
tb
=
client
.
messages
[
0
]
self
.
failUnless
(
"Unauthorized: You are not allowed"
in
tb
,
tb
)
def
testRenderUnauthorizedStandardClient
(
self
):
from
AccessControl
import
Unauthorized
def
f
():
...
...
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