mercurial/hgweb/common.py
changeset 40211 d216ae4cc3f6
parent 40158 9310037f0636
child 42922 8d9322b6e687
equal deleted inserted replaced
40210:8f192f2c4a1e 40211:d216ae4cc3f6
   181         if os.path.exists(path):
   181         if os.path.exists(path):
   182             break
   182             break
   183     try:
   183     try:
   184         os.stat(path)
   184         os.stat(path)
   185         ct = pycompat.sysbytes(
   185         ct = pycompat.sysbytes(
   186             mimetypes.guess_type(pycompat.fsdecode(path))[0] or "text/plain")
   186             mimetypes.guess_type(pycompat.fsdecode(path))[0] or r"text/plain")
   187         with open(path, 'rb') as fh:
   187         with open(path, 'rb') as fh:
   188             data = fh.read()
   188             data = fh.read()
   189 
   189 
   190         res.headers['Content-Type'] = ct
   190         res.headers['Content-Type'] = ct
   191         res.setbodybytes(data)
   191         res.setbodybytes(data)