equal
deleted
inserted
replaced
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) |