Author: mtredinnick
Date: 2008-08-23 13:08:28 -0500 (Sat, 23 Aug 2008)
New Revision: 8495

Modified:
   django/trunk/django/core/handlers/wsgi.py
Log:
Fixed #8259 -- Handle an error situation that we should never see, but still
occurs for some reason (be liberal in what you accept, and all that). Patch
from kevin.


Modified: django/trunk/django/core/handlers/wsgi.py
===================================================================
--- django/trunk/django/core/handlers/wsgi.py   2008-08-23 18:01:16 UTC (rev 
8494)
+++ django/trunk/django/core/handlers/wsgi.py   2008-08-23 18:08:28 UTC (rev 
8495)
@@ -173,7 +173,10 @@
             try:
                 # 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,


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to