changeset 3244:f045b049a704

Fix static file serving over HTTP on Windows. Files to be served should be opened in binary mode.
author Wojciech Milkowski <wmilkowski@interia.pl>
date Wed, 04 Oct 2006 18:06:03 +0200
parents 1d3aceae87c1
children 3bdeca8946a6
files mercurial/hgweb/common.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Tue Oct 03 16:36:40 2006 -0700
+++ b/mercurial/hgweb/common.py	Wed Oct 04 18:06:03 2006 +0200
@@ -38,7 +38,7 @@
         ct = mimetypes.guess_type(path)[0] or "text/plain"
         req.header([('Content-type', ct),
                     ('Content-length', os.path.getsize(path))])
-        return file(path).read()
+        return file(path, 'rb').read()
     except (TypeError, OSError):
         # illegal fname or unreadable file
         return ""