summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-11-21 13:06:51 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-11-21 13:06:51 +0000
commitb4d379d5e1dfbd00486defadcd4a404c315d5e9a (patch)
tree7b07879798e6b97e6ed5baf314b1b55be235fe47
parenta87d43f809c7614a749e9ef6af1c45ff4e075c0c (diff)
downloaddjango-b4d379d5e1dfbd00486defadcd4a404c315d5e9a.tar.gz
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
-rw-r--r--django/views/static.py2
1 files changed, 1 insertions, 1 deletions
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 = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">