Opened 7 years ago

Closed 6 years ago

Last modified 4 years ago

#9659 closed (fixed)

No output from `wsgi.file_wrapper`

Reported by: jborg Owned by: mitsuhiko
Component: HTTP handling Version: 1.0
Severity: Keywords:
Cc: jborg 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 mitsuhiko 6 years ago.
9659-fixed-filewrapper.2.patch (1.9 KB) - added by mitsuhiko 6 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by guettli

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Ticket #7894 does this change, too.

comment:2 Changed 6 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by russellm

  • Component changed from Uncategorized to HTTP handling

comment:4 Changed 6 years ago by mitsuhiko

  • Owner changed from nobody to mitsuhiko

comment:5 Changed 6 years ago by mitsuhiko

Applied the fix and created a testcase.

Changed 6 years ago by mitsuhiko

Changed 6 years ago by mitsuhiko

comment:6 Changed 6 years ago by mitsuhiko

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:7 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:8 Changed 6 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 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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