changeset 3879:f042906b346e

merged some 1.7 changesets
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Jul 2008 12:59:45 +0200
parents 6b9d964c70dc (current diff) b13a58a18dac (diff)
children 15bd8dae9003
files MoinMoin/caching.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/request_modpython.py	Sat Jul 19 14:10:15 2008 +0200
+++ b/MoinMoin/request/request_modpython.py	Sun Jul 27 12:59:45 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