summaryrefslogtreecommitdiff
path: root/flup
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 /flup
parent7970ea4013fcad711021284b442c9feb4630e742 (diff)
downloadflup-e6be19efbc42125896ed5db29673fec32b09c72f.tar.gz
Catch a strange FieldStorage case.
Diffstat (limited to 'flup')
-rw-r--r--flup/publisher.py29
1 files changed, 15 insertions, 14 deletions
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():