mercurial/extensions.py
changeset 52575 f106d0e629e5
parent 52367 89126d55e18c
child 52640 24ee91ba9aa8
--- a/mercurial/extensions.py	Tue Dec 17 00:56:01 2024 -0500
+++ b/mercurial/extensions.py	Tue Dec 17 01:00:59 2024 -0500
@@ -885,8 +885,7 @@
 
     This may raise IOError or SyntaxError.
     """
-    with open(path, 'rb') as src:
-        root = ast.parse(src.read(), path)
+    root = ast.parse(util.readfile(path), path)
     cmdtable = {}
 
     # Python 3.12 started removing Bytes and Str and deprecate harder