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/. ...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed 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. - LP #787541: Fix WSGIPublisher to close requests on abort unconditionally.
Previously an addAfterCommitHook was used, but this is not run on transaction Previously an addAfterCommitHook was used, but this is not run on transaction
aborts. Now a Synchronizer is used which unconditionally closes the request aborts. Now a Synchronizer is used which unconditionally closes the request
......
...@@ -53,11 +53,12 @@ class Functional(sandbox.Sandboxed): ...@@ -53,11 +53,12 @@ class Functional(sandbox.Sandboxed):
implements(interfaces.IFunctional) implements(interfaces.IFunctional)
@savestate @savestate
def publish(self, path, basic=None, env=None, request_method='GET', def publish(self, path, basic=None, env=None, extra=None,
stdin=None, handle_errors=True): request_method='GET', stdin=None, handle_errors=True):
'''Publishes the object at 'path' returning a response object.''' '''Publishes the object at 'path' returning a response object.'''
from StringIO import StringIO from StringIO import StringIO
from ZPublisher.Request import Request
from ZPublisher.Response import Response from ZPublisher.Response import Response
from ZPublisher.Publish import publish_module from ZPublisher.Publish import publish_module
...@@ -66,6 +67,8 @@ class Functional(sandbox.Sandboxed): ...@@ -66,6 +67,8 @@ class Functional(sandbox.Sandboxed):
if env is None: if env is None:
env = {} env = {}
if extra is None:
extra = {}
request = self.app.REQUEST request = self.app.REQUEST
...@@ -89,12 +92,14 @@ class Functional(sandbox.Sandboxed): ...@@ -89,12 +92,14 @@ class Functional(sandbox.Sandboxed):
outstream = StringIO() outstream = StringIO()
response = Response(stdout=outstream, stderr=sys.stderr) response = Response(stdout=outstream, stderr=sys.stderr)
request = Request(stdin, env, response)
for k, v in extra.items():
request[k] = v
publish_module('Zope2', publish_module('Zope2',
response=response,
stdin=stdin,
environ=env,
debug=not handle_errors, debug=not handle_errors,
request=request,
response=response,
) )
return ResponseWrapper(response, outstream, path) 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