Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1569 closed enhancement (fixed)

[patch] Streaming HttpResponse

Reported by: Maniac <Maniac@…> Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Maniac@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

HttpResponse should be able to accept not only strings but any iterator. This is most useful for streaming files without loading them into memory.

Patches follow.

Attachments (6)

1569.trunk.diff (5.1 KB) - added by Maniac <Maniac@…> 8 years ago.
Patch for trunk
1569.m-r.diff (5.1 KB) - added by Maniac <Maniac@…> 8 years ago.
Patch for magic-removal branch
1569.trunk.2.diff (4.9 KB) - added by Maniac <Maniac@…> 8 years ago.
More correct patch for trunk
1569.m-r.2.diff (5.0 KB) - added by Maniac <Maniac@…> 8 years ago.
More correct patch for magic-removal
1569.unicode.trunk.diff (2.2 KB) - added by Maniac <Maniac@…> 8 years ago.
Unicode-aware iterator (trunk)
1569.unicode.m-r.diff (2.2 KB) - added by Maniac <Maniac@…> 8 years ago.
Unicode-aware iterator (magic-removal)

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by Maniac <Maniac@…>

Patch for trunk

Changed 8 years ago by Maniac <Maniac@…>

Patch for magic-removal branch

comment:1 Changed 8 years ago by Maniac <Maniac@…>

  • Cc Maniac@… added
  • Summary changed from Streaming HttpResponse to [patch] Streaming HttpResponse

Changed 8 years ago by Maniac <Maniac@…>

More correct patch for trunk

Changed 8 years ago by Maniac <Maniac@…>

More correct patch for magic-removal

comment:2 Changed 8 years ago by adrian

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

(In [2639]) Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac

comment:3 Changed 8 years ago by django@…

Unicode is not getting encoded anymore - the content property does the encoding but this is bypassed by accessing the iterator in the handlers.

comment:4 Changed 8 years ago by adrian

  • Resolution fixed deleted
  • Status changed from closed to reopened

Good point, Kieran. I'm reopening.

Changed 8 years ago by Maniac <Maniac@…>

Unicode-aware iterator (trunk)

Changed 8 years ago by Maniac <Maniac@…>

Unicode-aware iterator (magic-removal)

comment:5 Changed 8 years ago by Maniac <Maniac@…>

Oops, sorry. I missed this when refactoring 2nd version of the patch.

New patch turns public iterator that is given to a handler into a generator converting unicode to default_charset if necessary.

Kieran, thanks for quick catch!

comment:6 Changed 8 years ago by adrian

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

(In [2675]) Fixed #1569 -- Made streaming HttpResponse unicode-aware

comment:7 Changed 8 years ago by Maniac <Maniac@…>

Thanks Adrian!

How about the second half of this thing in #1484 ? I've updated those patches for the current code.

comment:8 Changed 8 years ago by adrian

Good things (and commits) come to those who are patient.

comment:9 Changed 8 years ago by Maniac <Maniac@…>

Ok, I got it :-)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.