diff -r cac851655570 -r f106d0e629e5 mercurial/extensions.py --- 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