﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24158	Static serve failure since 1.4.18	TheRealEckat	Tim Graham	"With version 1.4.18 a change modified django.views.static.serve at line 65 for reading the file.
HttpResponse is called with the iter object, but this can't do anything with that.
From Django 1.5 the CompatibleStreamingHttpResponse is used at this point.

Reproducible by adding 
{{{
if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
   )

}}}
to the urls.py an call a file in that path.

The Response status is 200 and the content lenght is transmitted correctly.
In fact, only 0 bytes transferred.

A possible fix is, to change the line to
{{{
    response = HttpResponse(''.join(iter(lambda: f.read(STREAM_CHUNK_SIZE), '')), mimetype=mimetype)
}}}
"	Bug	closed	HTTP handling	1.4	Normal	fixed	development		Ready for checkin	1	0	0	0	0	0
