#15785: HttpRequest.read(NUM_BYTES) can read beyond the end of wsgi.input stream. (Violation of WSGI spec & under-defined behaviour) ---------------------------------------+----------------------------- Reporter: tomchristie | Owner: tomchristie Type: Bug | Status: new Milestone: 1.3 | Component: HTTP handling Version: 1.3-rc1 | Severity: Normal Resolution: | Keywords: http, wsgi Triage Stage: Accepted | Has patch: 1 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | ---------------------------------------+-----------------------------
Comment (by grahamd): If you are going to do: {{{ try: content_length = int(self.environ.get('CONTENT_LENGTH')) except ValueError: content_length = 0 }}} then you must catch TypeError as lack of CONTENT_LENGTH would return None which yields a TypeError when int() is applied to it. So yes, TypeError shouldn't have been needed in what they originally had, but is for what you have suggested. -- Ticket URL: <http://code.djangoproject.com/ticket/15785#comment:8> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.