Mercurial > moin > 1.9
changeset 3877:c4cf4327c96e
request_modpython: doing dirty tricks to work around mod_python 3.3.1 problems
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Fri, 18 Jul 2008 19:50:15 +0200 |
parents | 4f0dcb5fe7a6 |
children | b13a58a18dac |
files | MoinMoin/request/request_modpython.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/request/request_modpython.py Fri Jul 18 09:54:43 2008 +0200 +++ b/MoinMoin/request/request_modpython.py Fri Jul 18 19:50:15 2008 +0200 @@ -103,12 +103,19 @@ fixedResult.append(item.file) # Remember filenames with a name hack args[key + '__filename__'] = item.filename + # XXX Now it gets extremely dirty to work around a problem in mod_python 3.3.1: XXX + # Without the next line, item.file will be closed when item/form leaves this scope. + # I guess some reference counting is not implemented correctly for item.file, + # so we just keep a reference to item to keep it alive... + fixedResult.append(item) # we are lucky, nobody uses the 2nd list item anyway + # If you are reading this, please switch to mod_wsgi. :) elif isinstance(item, str): # mod_python 2.7 might return strings instead of Field objects. fixedResult.append(item) args[key] = fixedResult - return self.decodeArgs(args) + result = self.decodeArgs(args) + return result # XXX without the hack above, item.file gets closed when returning! XXX def run(self, req): """ mod_python calls this with its request object. We don't