summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Saddi <allan@saddi.com>2006-04-06 23:05:05 +0000
committerAllan Saddi <allan@saddi.com>2006-04-06 23:05:05 +0000
commite6be19efbc42125896ed5db29673fec32b09c72f (patch)
treee7af89935ce7e0a3f1e28ceb76c9217d6e79a388
parent7970ea4013fcad711021284b442c9feb4630e742 (diff)
downloadflup-e6be19efbc42125896ed5db29673fec32b09c72f.tar.gz
Catch a strange FieldStorage case.
-rw-r--r--ChangeLog5
-rw-r--r--flup/publisher.py29
2 files changed, 20 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index ae7a837..04867e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-06 Allan Saddi <asaddi@kalahari.flup.org>
+
+ * Catch a strange FieldStorage case. Seen in production.
+ Not quite sure what causes it.
+
2006-03-21 Allan Saddi <asaddi@kalahari.flup.org>
* Add maxRequests option to PreforkServer. Patch provided by
diff --git a/flup/publisher.py b/flup/publisher.py
index 73a8b30..a0c6676 100644
--- a/flup/publisher.py
+++ b/flup/publisher.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2002, 2005 Allan Saddi <allan@saddi.com>
+# Copyright (c) 2002, 2005, 2006 Allan Saddi <allan@saddi.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -85,19 +85,20 @@ class Request(object):
environ=self._environ, keep_blank_values=1)
# Collapse FieldStorage into a simple dict.
- for field in form.list:
- # Wrap uploaded files
- if field.filename:
- val = File(field)
- else:
- val = field.value
-
- # Add File/value to args, constructing a list if there are
- # multiple values.
- if self._form.has_key(field.name):
- self._form[field.name].append(val)
- else:
- self._form[field.name] = [val]
+ if form.list is not None:
+ for field in form.list:
+ # Wrap uploaded files
+ if field.filename:
+ val = File(field)
+ else:
+ val = field.value
+
+ # Add File/value to args, constructing a list if there are
+ # multiple values.
+ if self._form.has_key(field.name):
+ self._form[field.name].append(val)
+ else:
+ self._form[field.name] = [val]
# Unwrap lists with a single item.
for name,val in self._form.items():