Django

Code

Changeset 8495

Show
Ignore:
Timestamp:
08/23/08 13:08:28 (3 months ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/handlers/wsgi.py

    r8223 r8495  
    174174                # CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd) 
    175175                content_length = int(self.environ.get('CONTENT_LENGTH', 0)) 
    176             except ValueError: # if CONTENT_LENGTH was empty string or not an integer 
     176            except (ValueError, TypeError): 
     177                # If CONTENT_LENGTH was empty string or not an integer, don't 
     178                # error out. We've also seen None passed in here (against all 
     179                # specs, but see ticket #8259), so we handle TypeError as well. 
    177180                content_length = 0 
    178181            if content_length > 0: