diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -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: