Skip to content

Commit

Permalink
Avoid error when calling setBody with lock on a wsgi response.
Browse files Browse the repository at this point in the history
This happens with 'bin/test -s Products.Archetypes -t traversal.txt'
on the Plone coredev 5.1 zope4 config,
although the failing test may have meanwhile been removed.
  • Loading branch information
mauritsvanrees authored and davisagli committed Feb 25, 2017
1 parent d7b7c0e commit 6e548f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ZPublisher/HTTPResponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,9 @@ def write(self, data):

self.stdout.write(data)

def setBody(self, body, title='', is_error=0):
def setBody(self, body, title='', is_error=0, lock=None):
# lock is not used, but it may get passed in case of webdav,
# at least in tests that use the wsgi server.
if isinstance(body, IOBase):
body.seek(0, 2)
length = body.tell()
Expand Down

0 comments on commit 6e548f7

Please sign in to comment.