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)
...
@@ -11,6 +11,10 @@ Trunk (unreleased)
Restructuring
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
-
Testing
:
Functional
.
publish
now
uses
the
real
publish_module
function
instead
of
that
from
ZPublisher
.
Test
.
The
'extra'
argument
of
the
publish
instead
of
that
from
ZPublisher
.
Test
.
The
'extra'
argument
of
the
publish
method
is
no
longer
supported
.
method
is
no
longer
supported
.
...
...
src/Zope2/App/startup.py
View file @
7e7c3397
...
@@ -263,25 +263,20 @@ class ZPublisherExceptionHook:
...
@@ -263,25 +263,20 @@ class ZPublisherExceptionHook:
if
REQUEST
.
get
(
'AUTHENTICATED_USER'
,
None
)
is
None
:
if
REQUEST
.
get
(
'AUTHENTICATED_USER'
,
None
)
is
None
:
REQUEST
[
'AUTHENTICATED_USER'
]
=
AccessControl
.
User
.
nobody
REQUEST
[
'AUTHENTICATED_USER'
]
=
AccessControl
.
User
.
nobody
try
:
result
=
f
(
client
,
REQUEST
,
t
,
v
,
traceback
,
result
=
f
(
client
,
REQUEST
,
t
,
v
,
error_log_url
=
error_log_url
)
traceback
,
if
result
is
not
None
:
error_log_url
=
error_log_url
)
t
,
v
,
traceback
=
result
if
result
is
not
None
:
if
issubclass
(
t
,
Unauthorized
):
t
,
v
,
traceback
=
result
# Re-raise Unauthorized to make sure it is handled
if
issubclass
(
t
,
Unauthorized
):
# correctly. We can't do that with all exceptions
# Re-raise Unauthorized to make sure it is handled
# because some don't work with the rendered v as
# correctly. We can't do that with all exceptions
# argument.
# because some don't work with the rendered v as
raise
t
,
v
,
traceback
# argument.
response
=
REQUEST
.
RESPONSE
raise
t
,
v
,
traceback
response
.
setStatus
(
t
)
response
=
REQUEST
.
RESPONSE
response
.
setBody
(
v
)
response
.
setStatus
(
t
)
return
response
response
.
setBody
(
v
)
return
response
except
TypeError
:
# BBB: Pre Zope 2.6 call signature
f
(
client
,
REQUEST
,
t
,
v
,
traceback
)
finally
:
finally
:
traceback
=
None
traceback
=
None
...
...
src/Zope2/App/tests/testExceptionHook.py
View file @
7e7c3397
...
@@ -225,12 +225,6 @@ class Client(Acquisition.Explicit):
...
@@ -225,12 +225,6 @@ class Client(Acquisition.Explicit):
def
dummyMethod
(
self
):
def
dummyMethod
(
self
):
return
'Aye'
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
):
class
StandardClient
(
Client
):
def
raise_standardErrorMessage
(
self
,
c
,
r
,
t
,
v
,
tb
,
error_log_url
):
def
raise_standardErrorMessage
(
self
,
c
,
r
,
t
,
v
,
tb
,
error_log_url
):
...
@@ -245,17 +239,6 @@ class BrokenClient(Client):
...
@@ -245,17 +239,6 @@ class BrokenClient(Client):
class
ExceptionMessageRenderTest
(
ExceptionHookTestCase
):
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
):
def
testRenderUnauthorizedStandardClient
(
self
):
from
AccessControl
import
Unauthorized
from
AccessControl
import
Unauthorized
def
f
():
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