aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/parsers.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/parsers.py')
-rw-r--r--rest_framework/parsers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py
index cb23423d..437d1339 100644
--- a/rest_framework/parsers.py
+++ b/rest_framework/parsers.py
@@ -152,7 +152,7 @@ class FileUploadParser(BaseParser):
None,
encoding)
if result is not None:
- return DataAndFiles(None, {'file': result[1]})
+ return DataAndFiles({}, {'file': result[1]})
# This is the standard case.
possible_sizes = [x.chunk_size for x in upload_handlers if x.chunk_size]
@@ -179,7 +179,7 @@ class FileUploadParser(BaseParser):
for index, handler in enumerate(upload_handlers):
file_obj = handler.file_complete(counters[index])
if file_obj:
- return DataAndFiles(None, {'file': file_obj})
+ return DataAndFiles({}, {'file': file_obj})
raise ParseError("FileUpload parse error - "
"none of upload handlers can handle the stream")
@@ -200,7 +200,7 @@ class FileUploadParser(BaseParser):
if 'filename*' in filename_parm:
return self.get_encoded_filename(filename_parm)
return force_text(filename_parm['filename'])
- except (AttributeError, KeyError):
+ except (AttributeError, KeyError, ValueError):
pass
def get_encoded_filename(self, filename_parm):