Commit 625b1ed8 authored by 's avatar

- re-added 'extra' argument (someone was missing it)

parent 9d0c6bf3
......@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
++++++++++
- Testing: Re-added 'extra' argument to Functional.publish.
Removing it in Zope 2.13.0a1 did break backwards compatibility.
- LP #787541: Fix WSGIPublisher to close requests on abort unconditionally.
Previously an addAfterCommitHook was used, but this is not run on transaction
aborts. Now a Synchronizer is used which unconditionally closes the request
......
......@@ -53,11 +53,12 @@ class Functional(sandbox.Sandboxed):
implements(interfaces.IFunctional)
@savestate
def publish(self, path, basic=None, env=None, request_method='GET',
stdin=None, handle_errors=True):
def publish(self, path, basic=None, env=None, extra=None,
request_method='GET', stdin=None, handle_errors=True):
'''Publishes the object at 'path' returning a response object.'''
from StringIO import StringIO
from ZPublisher.Request import Request
from ZPublisher.Response import Response
from ZPublisher.Publish import publish_module
......@@ -66,6 +67,8 @@ class Functional(sandbox.Sandboxed):
if env is None:
env = {}
if extra is None:
extra = {}
request = self.app.REQUEST
......@@ -89,12 +92,14 @@ class Functional(sandbox.Sandboxed):
outstream = StringIO()
response = Response(stdout=outstream, stderr=sys.stderr)
request = Request(stdin, env, response)
for k, v in extra.items():
request[k] = v
publish_module('Zope2',
response=response,
stdin=stdin,
environ=env,
debug=not handle_errors,
request=request,
response=response,
)
return ResponseWrapper(response, outstream, path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment