From f4fce99bc1247f333c4093f3cfa077f7acd8d541 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 13 May 2009 18:45:16 +0000 Subject: [1.0.X] Fixed #10687: fixed request parsing when upload_handlers is empty. Thanks, Armin Ronacher. Backport of [10723] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10765 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/files/base.py | 2 -- django/http/multipartparser.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'django') diff --git a/django/core/files/base.py b/django/core/files/base.py index 69739d6488..596fbd745a 100644 --- a/django/core/files/base.py +++ b/django/core/files/base.py @@ -1,7 +1,5 @@ import os - from django.utils.encoding import smart_str, smart_unicode - try: from cStringIO import StringIO except ImportError: diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index 048c9aaea2..e45d5d1035 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -84,7 +84,8 @@ class MultiPartParser(object): # For compatibility with low-level network APIs (with 32-bit integers), # the chunk size should be < 2^31, but still divisible by 4. - self._chunk_size = min(2**31-4, *[x.chunk_size for x in upload_handlers if x.chunk_size]) + possible_sizes = [x.chunk_size for x in upload_handlers if x.chunk_size] + self._chunk_size = min([2**31-4] + possible_sizes) self._meta = META self._encoding = encoding or settings.DEFAULT_CHARSET -- cgit v1.3