changeset 36477:035b77bf01d2

py3: make sure we write in mergestate in bytes mode Differential Revision: https://phab.mercurial-scm.org/D2501
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 28 Feb 2018 21:44:28 +0530
parents 263368dc143f
children a6e9a360ccd8
files mercurial/merge.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Wed Feb 28 21:43:35 2018 +0530
+++ b/mercurial/merge.py	Wed Feb 28 21:44:28 2018 +0530
@@ -399,7 +399,7 @@
 
     def _writerecordsv1(self, records):
         """Write current state on disk in a version 1 file"""
-        f = self._repo.vfs(self.statepathv1, 'w')
+        f = self._repo.vfs(self.statepathv1, 'wb')
         irecords = iter(records)
         lrecords = next(irecords)
         assert lrecords[0] == 'L'
@@ -415,7 +415,7 @@
         See the docstring for _readrecordsv2 for why we use 't'."""
         # these are the records that all version 2 clients can read
         whitelist = 'LOF'
-        f = self._repo.vfs(self.statepathv2, 'w')
+        f = self._repo.vfs(self.statepathv2, 'wb')
         for key, data in records:
             assert len(key) == 1
             if key not in whitelist: