diff options
author | Allan Saddi <allan@saddi.com> | 2006-04-06 23:05:05 +0000 |
---|---|---|
committer | Allan Saddi <allan@saddi.com> | 2006-04-06 23:05:05 +0000 |
commit | e6be19efbc42125896ed5db29673fec32b09c72f (patch) | |
tree | e7af89935ce7e0a3f1e28ceb76c9217d6e79a388 | |
parent | 7970ea4013fcad711021284b442c9feb4630e742 (diff) | |
download | flup-e6be19efbc42125896ed5db29673fec32b09c72f.tar.gz |
Catch a strange FieldStorage case.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | flup/publisher.py | 29 |
2 files changed, 20 insertions, 14 deletions
@@ -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(): |