From patchwork Tue Jan 14 09:02:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: remotefilelog: fix opening validatecachelog in text mode From: Inada Naoki X-Patchwork-Id: 44478 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 14 Jan 2020 18:02:47 +0900 # HG changeset patch # User Inada Naoki # Date 1578992235 -32400 # Tue Jan 14 17:57:15 2020 +0900 # Node ID b8231c6f3cdd3dd56eb0b9aa24b70644ec3d0026 # Parent 8e09551206f54bb102cdcbf4c57b0b10284735ce remotefilelog: fix opening validatecachelog in text mode diff -r 8e09551206f5 -r b8231c6f3cdd hgext/remotefilelog/basestore.py --- a/hgext/remotefilelog/basestore.py Sat Jan 11 05:44:58 2020 +0100 +++ b/hgext/remotefilelog/basestore.py Tue Jan 14 17:57:15 2020 +0900 @@ -225,7 +225,7 @@ class basestore(object): data = shallowutil.readfile(filepath) if self._validatecache and not self._validatedata(data, filepath): if self._validatecachelog: - with open(self._validatecachelog, b'a+') as f: + with open(self._validatecachelog, b'ab+') as f: f.write(b"corrupt %s during read\n" % filepath) os.rename(filepath, filepath + b".corrupt") raise KeyError(b"corrupt local cache file %s" % filepath)