From b4d379d5e1dfbd00486defadcd4a404c315d5e9a Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 21 Nov 2005 13:06:51 +0000 Subject: [PATCH] Fixed #866: static.serve view no longer opens files in text mode -- thanks, Eugene git-svn-id: http://code.djangoproject.com/svn/django/trunk@1331 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/views/static.py b/django/views/static.py index f74570c307..28e43ec612 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -47,7 +47,7 @@ def serve(request, path, document_root=None, show_indexes=False): raise Http404, '"%s" does not exist' % fullpath else: mimetype = mimetypes.guess_type(fullpath)[0] - return HttpResponse(open(fullpath).read(), mimetype=mimetype) + return HttpResponse(open(fullpath, 'rb').read(), mimetype=mimetype) DEFAULT_DIRECTORY_INDEX_TEMPLATE = """