mercurial/hgweb/common.py
changeset 52576 08612516d436
parent 52366 c9baa3541b20
--- a/mercurial/hgweb/common.py	Tue Dec 17 01:00:59 2024 -0500
+++ b/mercurial/hgweb/common.py	Tue Dec 17 01:10:28 2024 -0500
@@ -219,8 +219,7 @@
     path = os.path.join(directory, fpath)
     try:
         os.stat(path)
-        with open(path, 'rb') as fh:
-            data = fh.read()
+        data = util.readfile(path)
     except TypeError:
         raise ErrorResponse(HTTP_SERVER_ERROR, b'illegal filename')
     except OSError as err: