Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#9659 closed (fixed)

No output from `wsgi.file_wrapper`

Reported by: Jonas Borgström Owned by: Armin Ronacher
Component: HTTP handling Version: 1.0
Severity: Keywords:
Cc: Jonas Borgström Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The development server exposes the wsgi.file_wrapper extension but a typo in ServerHandler.finish_responsestops any file contents from making it to the browser.

  • django/core/servers/basehttp.py

     
    313313        in the event loop to iterate over the data, and to call
    314314        'self.close()' once the response is finished.
    315315        """
    316         if not self.result_is_file() and not self.sendfile():
     316        if not self.result_is_file() or not self.sendfile():
    317317            for data in self.result:
    318318                self.write(data)
    319319            self.finish_content()

Attachments (2)

9659-fixed-filewrapper.patch (2.6 KB) - added by Armin Ronacher 7 years ago.
9659-fixed-filewrapper.2.patch (1.9 KB) - added by Armin Ronacher 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by Thomas Güttler

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Ticket #7894 does this change, too.

comment:2 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Russell Keith-Magee

Component: UncategorizedHTTP handling

comment:4 Changed 7 years ago by Armin Ronacher

Owner: changed from nobody to Armin Ronacher

comment:5 Changed 7 years ago by Armin Ronacher

Applied the fix and created a testcase.

Changed 7 years ago by Armin Ronacher

Changed 7 years ago by Armin Ronacher

comment:6 Changed 7 years ago by Armin Ronacher

Triage Stage: AcceptedReady for checkin

The latter has a better name for the tests. (basehttp_server)

comment:7 Changed 7 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [10690]) Fixed #9659: fixed wsgi.file_wrapper in the builtin server. Thanks, mitsuhiko.

comment:8 Changed 7 years ago by Jacob

(In [10691]) [1.0.X] Fixed #9659: fixed wsgi.file_wrapper in the builtin server. Thanks, mitsuhiko. Backport of [10690] from trunk.

comment:9 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top