mercurial/filemerge.py
changeset 48786 f20feb496d3c
parent 48785 b53f2f5a18de
child 48787 69000dc0dced
--- a/mercurial/filemerge.py	Mon Feb 14 22:04:50 2022 -0800
+++ b/mercurial/filemerge.py	Mon Feb 14 22:11:50 2022 -0800
@@ -944,8 +944,8 @@
     d = localpath
     if localpath is not None:
         f, d = maketempfrompath(b"local", d)
-        with open(localpath, b'rb') as src:
-            f.write(src.read())
+        data = util.readfile(localpath)
+        f.write(data)
         f.close()
 
     try: