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
3753d1a2
Commit
3753d1a2
authored
Aug 12, 2008
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Launchpad #257269: 'raise SystemExit' with a PythonScript could shutdown
a complete Zope instance
parent
c980fe1b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+5
-1
lib/python/Products/PythonScripts/tests/testPythonScript.py
lib/python/Products/PythonScripts/tests/testPythonScript.py
+5
-0
No files found.
doc/CHANGES.txt
View file @
3753d1a2
...
@@ -204,6 +204,9 @@ Zope Changes
...
@@ -204,6 +204,9 @@ Zope Changes
Bugs Fixed
Bugs Fixed
- Launchpad #257269: 'raise SystemExit' with a PythonScript could shutdown
a complete Zope instance
- DateTime conversion of datetime objects with non-pytz tzinfo.
- DateTime conversion of datetime objects with non-pytz tzinfo.
Timezones() returns a copy of the timezone list (allows tests to run).
Timezones() returns a copy of the timezone list (allows tests to run).
...
...
lib/python/Products/PythonScripts/PythonScript.py
View file @
3753d1a2
...
@@ -322,7 +322,11 @@ class PythonScript(Script, Historical, Cacheable):
...
@@ -322,7 +322,11 @@ class PythonScript(Script, Historical, Cacheable):
g
[
'__file__'
]
=
getattr
(
self
,
'_filepath'
,
None
)
or
self
.
get_filepath
()
g
[
'__file__'
]
=
getattr
(
self
,
'_filepath'
,
None
)
or
self
.
get_filepath
()
f
=
new
.
function
(
fcode
,
g
,
None
,
fadefs
)
f
=
new
.
function
(
fcode
,
g
,
None
,
fadefs
)
try
:
result
=
f
(
*
args
,
**
kw
)
result
=
f
(
*
args
,
**
kw
)
except
SystemExit
:
raise
ValueError
(
'SystemExit can not raised with a PythonScript'
)
if
keyset
is
not
None
:
if
keyset
is
not
None
:
# Store the result in the cache.
# Store the result in the cache.
self
.
ZCacheable_set
(
result
,
keywords
=
keyset
)
self
.
ZCacheable_set
(
result
,
keywords
=
keyset
)
...
...
lib/python/Products/PythonScripts/tests/testPythonScript.py
View file @
3753d1a2
...
@@ -222,6 +222,11 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
...
@@ -222,6 +222,11 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
res
=
self
.
_newPS
(
"return DateTime('2007/12/10').strftime('%d.%m.%Y')"
)()
res
=
self
.
_newPS
(
"return DateTime('2007/12/10').strftime('%d.%m.%Y')"
)()
self
.
assertEqual
(
res
,
'10.12.2007'
)
self
.
assertEqual
(
res
,
'10.12.2007'
)
def
testRaiseSystemExitLaunchpad257269
(
self
):
ps
=
self
.
_newPS
(
"raise SystemExit"
)
self
.
assertRaises
(
ValueError
,
ps
)
class
TestPythonScriptErrors
(
PythonScriptTestBase
):
class
TestPythonScriptErrors
(
PythonScriptTestBase
):
...
...
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