Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #866: static.serve view no longer opens files in text mode -- t…

…hanks, Eugene

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b4d379d5e1dfbd00486defadcd4a404c315d5e9a 1 parent a87d43f
Jacob Kaplan-Moss jacobian authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/views/static.py
2  django/views/static.py
View
@@ -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">
Please sign in to comment.
Something went wrong with that request. Please try again.