Ticket #9054: 9054-modpython-workaround.diff

File 9054-modpython-workaround.diff, 1.2 KB (added by chris chamberlin, 10 years ago)

partial hack for mod_python handler

  • django/core/handlers/modpython.py

    diff -ru Django-1.0/django/core/handlers/modpython.py Django-1.0-patched/django/core/handlers/modpython.py
    old new  
    11import os
    22from pprint import pformat
     3import StringIO
    34
    45from django import http
    56from django.core import signals
     
    7677    def _load_post_and_files(self):
    7778        "Populates self._post and self._files"
    7879        if 'content-type' in self._req.headers_in and self._req.headers_in['content-type'].startswith('multipart'):
    79             self._raw_post_data = ''
     80            if hasattr(self, '_raw_post_data'):
     81                rq = StringIO.StringIO(self._raw_post_data)
     82            else:
     83                self._raw_post_data = ''
     84                rq = self._req
    8085            try:
    81                 self._post, self._files = self.parse_file_upload(self.META, self._req)
     86                self._post, self._files = self.parse_file_upload(self.META, rq)
    8287            except:
    8388                # See django.core.handlers.wsgi.WSGIHandler for an explanation
    8489                # of what's going on here.
Back to Top