Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14602 -- Added an extra check to wsgi.input handling to preven…

…t AppEngine from choking. Thanks to Waldemar Kornewald for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c906b270f5bc53d9657c5f0bdb98a3015c9f8c71 1 parent 05db03c
Russell Keith-Magee authored November 04, 2010

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  django/core/handlers/wsgi.py
5  django/core/handlers/wsgi.py
@@ -134,7 +134,7 @@ def __init__(self, environ):
134 134
         self.META['SCRIPT_NAME'] = script_name
135 135
         self.method = environ['REQUEST_METHOD'].upper()
136 136
         self._post_parse_error = False
137  
-        if isinstance(self.environ['wsgi.input'], socket._fileobject):
  137
+        if type(socket._fileobject) is type and isinstance(self.environ['wsgi.input'], socket._fileobject):
138 138
             # Under development server 'wsgi.input' is an instance of
139 139
             # socket._fileobject which hangs indefinitely on reading bytes past
140 140
             # available count. To prevent this it's wrapped in LimitedStream
@@ -144,6 +144,9 @@ def __init__(self, environ):
144 144
             # streams) beacuse they don't suffer from this problem and we can
145 145
             # avoid using another wrapper with its own .read and .readline
146 146
             # implementation.
  147
+            #
  148
+            # The type check is done because for some reason, AppEngine
  149
+            # implements _fileobject as a function, not a class.
147 150
             try:
148 151
                 content_length = int(self.environ.get('CONTENT_LENGTH', 0))
149 152
             except (ValueError, TypeError):

0 notes on commit c906b27

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