From patchwork Sun Nov 24 05:45:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7517: filemerge: byteify the open() mode From: phabricator X-Patchwork-Id: 43509 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sun, 24 Nov 2019 05:45:24 +0000 mharbison72 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is actually `pycompat.open()`, so it need bytes. It regressed recently on default. VSCode flagged some invalid mode to open() the other day, but I don't remember where. That's what got me searching in this area. I'm almost certain that it was the other way (i.e. saying open doesn't take bytes), but I can't find that now. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7517 AFFECTED FILES mercurial/filemerge.py CHANGE DETAILS To: mharbison72, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -934,7 +934,7 @@ name = os.path.join(tmproot, pre) if ext: name += ext - f = open(name, "wb") + f = open(name, b"wb") else: fd, name = pycompat.mkstemp(prefix=pre + b'.', suffix=ext) f = os.fdopen(fd, "wb")