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
ff723d95
Commit
ff723d95
authored
Feb 03, 2004
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch unauthorized binding errors when formatting an exception
parent
17568f78
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
lib/python/Products/PageTemplates/TALES.py
lib/python/Products/PageTemplates/TALES.py
+10
-3
No files found.
lib/python/Products/PageTemplates/TALES.py
View file @
ff723d95
...
@@ -15,13 +15,14 @@
...
@@ -15,13 +15,14 @@
An implementation of a generic TALES engine
An implementation of a generic TALES engine
"""
"""
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
9
$'
[
11
:
-
2
]
import
re
,
sys
,
ZTUtils
import
re
,
sys
,
ZTUtils
from
weakref
import
ref
from
weakref
import
ref
from
MultiMapping
import
MultiMapping
from
MultiMapping
import
MultiMapping
from
DocumentTemplate.DT_Util
import
ustr
from
DocumentTemplate.DT_Util
import
ustr
from
GlobalTranslationService
import
getGlobalTranslationService
from
GlobalTranslationService
import
getGlobalTranslationService
from
zExceptions
import
Unauthorized
StringType
=
type
(
''
)
StringType
=
type
(
''
)
...
@@ -270,12 +271,18 @@ class TALESTracebackSupplement:
...
@@ -270,12 +271,18 @@ class TALESTracebackSupplement:
def
getInfo
(
self
,
as_html
=
0
):
def
getInfo
(
self
,
as_html
=
0
):
import
pprint
import
pprint
from
cgi
import
escape
data
=
self
.
context
.
contexts
.
copy
()
data
=
self
.
context
.
contexts
.
copy
()
try
:
s
=
pprint
.
pformat
(
data
)
s
=
pprint
.
pformat
(
data
)
except
Unauthorized
,
e
:
s
=
' - %s: %s'
%
(
getattr
(
e
,
'__class__'
,
type
(
e
)),
e
)
if
as_html
:
s
=
escape
(
s
)
return
s
if
not
as_html
:
if
not
as_html
:
return
' - Names:
\
n
%s'
%
s
.
replace
(
'
\
n
'
,
'
\
n
'
)
return
' - Names:
\
n
%s'
%
s
.
replace
(
'
\
n
'
,
'
\
n
'
)
else
:
else
:
from
cgi
import
escape
return
'<b>Names:</b><pre>%s</pre>'
%
(
escape
(
s
))
return
'<b>Names:</b><pre>%s</pre>'
%
(
escape
(
s
))
...
...
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