Bug#584827: [bottlepy] WSGI file_wrapper optimisation cannot possibly work

2010-06-19 Thread Enrico Zini
On Sat, Jun 19, 2010 at 12:11:39AM +0200, Marcel Hellkamp wrote: So, much more simple and readable, and with only one environ lookup: # Cast Files into iterables if hasattr(out, 'read'): wrapper = request.environ.get('wsgi.file_wrapper', None)

Bug#584827: [bottlepy] WSGI file_wrapper optimisation cannot possibly work

2010-06-19 Thread Marcel Hellkamp
Am Samstag, den 19.06.2010, 08:33 +0200 schrieb Enrico Zini: ...in this case we still lose the .close() method in case wsgi.file_wrapper is not present in the environment. True. I simplified your wrapper a bit but hope it still catches all eventualities. See

Bug#584827: [bottlepy] WSGI file_wrapper optimisation cannot possibly work

2010-06-18 Thread Marcel Hellkamp
Sorry for the late answer. On Sun, Jun 06, 2010 at 11:33:20PM +0100, Enrico Zini wrote: Bottle seems to be extracting the first element from the iterable in order to look at what the iterator returns and possibly add transparent recoding and whatnot, then it returns a chain iterator with the