py3: make sure we open the file to write in bytes mode
Differential Revision: https://phab.mercurial-scm.org/D1797
--- a/mercurial/subrepo.py Fri Dec 29 05:47:17 2017 +0530
+++ b/mercurial/subrepo.py Fri Dec 29 05:29:57 2017 +0530
@@ -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: