[Zope-Checkins] SVN: Zope/trunk/src/ZPublisher/WSGIPublisher.py An interaction must end, once begun. Wrap in try-finally.
Malthe Borch
cvs-admin at zope.org
Fri Oct 19 13:24:04 UTC 2012
Log message for revision 128071:
An interaction must end, once begun. Wrap in try-finally.
Changed:
U Zope/trunk/src/ZPublisher/WSGIPublisher.py
-=-
Modified: Zope/trunk/src/ZPublisher/WSGIPublisher.py
===================================================================
--- Zope/trunk/src/ZPublisher/WSGIPublisher.py 2012-10-19 09:29:40 UTC (rev 128070)
+++ Zope/trunk/src/ZPublisher/WSGIPublisher.py 2012-10-19 13:24:00 UTC (rev 128071)
@@ -167,48 +167,49 @@
notify(PubStart(request))
newInteraction()
- request.processInputs()
- response = request.response
+ try:
+ request.processInputs()
+ response = request.response
- if bobo_after is not None:
- response.after_list += (bobo_after,)
+ if bobo_after is not None:
+ response.after_list += (bobo_after,)
- if debug_mode:
- response.debug_mode = debug_mode
+ if debug_mode:
+ response.debug_mode = debug_mode
- if realm and not request.get('REMOTE_USER', None):
- response.realm = realm
+ if realm and not request.get('REMOTE_USER', None):
+ response.realm = realm
- if bobo_before is not None:
- bobo_before()
+ if bobo_before is not None:
+ bobo_before()
- # Get the path list.
- # According to RFC1738 a trailing space in the path is valid.
- path = request.get('PATH_INFO')
+ # Get the path list.
+ # According to RFC1738 a trailing space in the path is valid.
+ path = request.get('PATH_INFO')
- request['PARENTS'] = [object]
- object = request.traverse(path, validated_hook=validated_hook)
- notify(PubAfterTraversal(request))
+ request['PARENTS'] = [object]
+ object = request.traverse(path, validated_hook=validated_hook)
+ notify(PubAfterTraversal(request))
- if transactions_manager:
- transactions_manager.recordMetaData(object, request)
+ if transactions_manager:
+ transactions_manager.recordMetaData(object, request)
- result = mapply(object,
- request.args,
- request,
- call_object,
- 1,
- missing_name,
- dont_publish_class,
- request,
- bind=1,
- )
+ result = mapply(object,
+ request.args,
+ request,
+ call_object,
+ 1,
+ missing_name,
+ dont_publish_class,
+ request,
+ bind=1,
+ )
- if result is not response:
- response.setBody(result)
+ if result is not response:
+ response.setBody(result)
+ finally:
+ endInteraction()
- endInteraction()
-
notify(PubBeforeCommit(request))
return response
More information about the Zope-Checkins
mailing list