diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2017-03-24 22:00:47 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2017-03-24 22:00:47 +0100 |
commit | f140d01d3eea4c82e3ab1f10600148c4946bcbbc (patch) | |
tree | 1fdb6e78ef95568b454935fea09569cb7ddc3f6c | |
parent | fa511457866b36bf3686d9398495371363672b77 (diff) |
Open static files with mode = 'rb'.
This is a more sane mode for our use, and allows the code to work in
python 3, which expects bytes.
-rw-r--r-- | pastepy.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -214,7 +214,7 @@ class Paste(object): self.start_response('404 Not Found', [('Content-Type', 'text/html; charset=utf-8'), ('Location', '/')]) return ['<a href="/">asdf</a>'] self.start_response('200 OK', [('Content-Type', mimetypes.guess_type(filename)[0] or 'text/plain; charset=utf-8')]) - return open(filename) + return open(filename, 'rb') def __call__(self, environ, start_response): self.environ = environ |