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
febd0887
Commit
febd0887
authored
Feb 22, 2007
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Plain Diff
Merged r72753:72754 from 2.9 branch.
Raise SyntaxError when encountering invalid PythonScript headers.
parents
9e33dc1c
1f7195aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+1
-1
lib/python/Products/PythonScripts/tests/testPythonScript.py
lib/python/Products/PythonScripts/tests/testPythonScript.py
+3
-0
lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps
.../Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps
+3
-0
No files found.
lib/python/Products/PythonScripts/PythonScript.py
View file @
febd0887
...
...
@@ -417,7 +417,7 @@ class PythonScript(Script, Historical, Cacheable):
k
=
k
.
strip
().
lower
()
v
=
v
.
strip
()
if
not
mdata
.
has_key
(
k
):
SyntaxError
,
'Unrecognized header line "%s"'
%
line
raise
SyntaxError
,
'Unrecognized header line "%s"'
%
line
if
v
==
mdata
[
k
]:
# Unchanged value
continue
...
...
lib/python/Products/PythonScripts/tests/testPythonScript.py
View file @
febd0887
...
...
@@ -197,6 +197,9 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
bound
=
f
.
__render_with_namespace__
({
'yes'
:
1
,
'no'
:
self
.
fail
})
self
.
assertEqual
(
bound
,
1
)
def
testNSBindInvalidHeader
(
self
):
self
.
assertRaises
(
SyntaxError
,
self
.
_filePS
,
'ns_bind_invalid'
)
def
testBooleanMap
(
self
):
res
=
self
.
_filePS
(
'boolean_map'
)()
self
.
failUnless
(
res
)
...
...
lib/python/Products/PythonScripts/tests/tscripts/ns_bind_invalid.ps
0 → 100644
View file @
febd0887
##parameters=yes
##unknownheader='foo'
return
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