Patchwork D1797: py3: make sure we open the file to write in bytes mode

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2018, 11:04 p.m.
Message ID <5ea8ab98feea9310d3bfcf61efb42ead@localhost.localdomain>
Download mbox | patch
Permalink /patch/26664/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2018, 11:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf2f0a777b2e2: py3: make sure we open the file to write in bytes mode (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1797?vs=4674&id=4780

REVISION DETAIL
  https://phab.mercurial-scm.org/D1797

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -811,7 +811,7 @@ 
         with self._repo.lock():
             storehash = list(self._calcstorehash(remotepath))
             vfs = self._cachestorehashvfs
-            vfs.writelines(cachefile, storehash, mode='w', notindexed=True)
+            vfs.writelines(cachefile, storehash, mode='wb', notindexed=True)
 
     def _getctx(self):
         '''fetch the context for this subrepo revision, possibly a workingctx
@@ -841,7 +841,7 @@ 
             if defpath != defpushpath:
                 addpathconfig('default-push', defpushpath)
 
-            fp = self._repo.vfs("hgrc", "w", text=True)
+            fp = self._repo.vfs("hgrc", "wb", text=True)
             try:
                 fp.write(''.join(lines))
             finally: