Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #8259 -- Handle an error situation that we should never see, bu…

…t still

occurs for some reason (be liberal in what you accept, and all that). Patch
from kevin.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 64ca36b commit 77bf14d5817d6b8bcea26607fb52b57d0908ffac @malcolmt malcolmt committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/core/handlers/
5 django/core/handlers/
@@ -173,7 +173,10 @@ def _get_raw_post_data(self):
# CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd)
content_length = int(self.environ.get('CONTENT_LENGTH', 0))
- except ValueError: # if CONTENT_LENGTH was empty string or not an integer
+ except (ValueError, TypeError):
+ # If CONTENT_LENGTH was empty string or not an integer, don't
+ # error out. We've also seen None passed in here (against all
+ # specs, but see ticket #8259), so we handle TypeError as well.
content_length = 0
if content_length > 0:
safe_copyfileobj(self.environ['wsgi.input'], buf,

0 comments on commit 77bf14d

Please sign in to comment.
Something went wrong with that request. Please try again.