[patch] HttpResponse should support close() for iterators
|Reported by:||Ivan Sagalaev <Maniac@…>||Owned by:||adrian|
|Cc:||Maniac@…, mtredinnick||Triage Stage:||Unreviewed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
WSGI kinda suggests that a server should call 'close()' method of after getting content from a response iterator if it has one. This is very logical since one of the most common examples of an iterator is a file and it really should be closed afterwards. And incidentally 'flup' which is commonly used to run FastCGI server indeed does this.
The problem is that our HttpResponse wraps the actual iterator into a generator (for unicode conversion). And this generator doesn't have 'close()' method and hence the iterator never closed.
I've rewrote this to handle 'close()', patch follows.
Change History (7)
Changed 10 years ago by Ivan Sagalaev <Maniac@…>
comment:2 Changed 10 years ago by adrian
- Summary changed from HttpResponse should support close() for iterators to [patch] HttpResponse should support close() for iterators
comment:3 Changed 10 years ago by mtredinnick
- Resolution set to fixed
- Status changed from new to closed