Edgewall Software

Changeset 7377

Show
Ignore:
Timestamp:
07/22/2008 01:40:29 PM (5 weeks ago)
Author:
cmlenz
Message:

Merged [7376] to trunk.

Location:
trunk/trac/web
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/trac/web/api.py

    r7051 r7377  
    3030from trac.util.datefmt import http_date, localtz 
    3131from trac.web.href import Href 
     32from trac.web.wsgi import _FileWrapper 
    3233 
    3334HTTP_STATUS = dict([(code, reason.title()) for code, (reason, description) 
     
    401402 
    402403        if self.method != 'HEAD': 
    403             self._response = file(path, 'rb') 
    404             file_wrapper = self.environ.get('wsgi.file_wrapper') 
    405             if file_wrapper: 
    406                 self._response = file_wrapper(self._response, 4096) 
     404            fileobj = file(path, 'rb') 
     405            file_wrapper = self.environ.get('wsgi.file_wrapper', _FileWrapper) 
     406            self._response = file_wrapper(fileobj, 4096) 
    407407        raise RequestDone 
    408408 
  • trunk/trac/web/wsgi.py

    r6904 r7377  
    8787        response = application(self.environ, self._start_response) 
    8888        try: 
    89             if isinstance(response, self.wsgi_file_wrapper) \ 
     89            if self.wsgi_file_wrapper is not None \ 
     90                    and isinstance(response, self.wsgi_file_wrapper) \ 
    9091                    and hasattr(self, '_sendfile'): 
    9192                self._sendfile(response.fileobj)