# HG changeset patch # User Alexis S. L. Carvalho # Date 1145472082 25200 # Node ID 0bf2a9e5eff1b9fac3f165c6d2ac3b116931642e # Parent c067ee483d2e4e962bc9f718a5119625aac0f2c8 Don't send "Content-Type: none" mimetypes.guess_type will return (None, None) when it can't detect the filetype. diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -419,7 +419,8 @@ class hgweb(object): mt = mimetypes.guess_type(f)[0] rawtext = text if util.binary(text): - text = "(binary:%s)" % mt + text = "(binary:%s)" % (mt or 'data') + mt = mt or 'text/plain' def lines(): for l, t in enumerate(text.splitlines(1)):