diff MoinMoin/request/request_modpython.py @ 3568:6fe1ea4d9d1a

use the open temporary file for file uploads (fixes big memory consumption for big file uploads) - Twisted and mod_python is completely untested
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 08 May 2008 10:10:12 +0200
parents 91d38a790d8e
children fee546fba271
line wrap: on
line diff
--- a/MoinMoin/request/request_modpython.py	Tue May 06 22:52:39 2008 +0200
+++ b/MoinMoin/request/request_modpython.py	Thu May 08 10:10:12 2008 +0200
@@ -93,16 +93,16 @@
             if not isinstance(values, list):
                 values = [values]
             fixedResult = []
-
             for item in values:
-                # Remember filenames with a name hack
-                if hasattr(item, 'filename') and item.filename:
+                if isinstance(item, util.StringField):
+                    fixedResult.append(item.value)
+                elif isinstance(item, util.Field) and item.filename:
+                    fixedResult.append(item.file)
+                    # Remember filenames with a name hack
                     args[key + '__filename__'] = item.filename
-                # mod_python 2.7 might return strings instead of Field
-                # objects.
-                if hasattr(item, 'value'):
-                    item = item.value
-                fixedResult.append(item)
+                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)