D5597: remotefilelog: do file IO in terms of bytes

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jan 16 16:16:04 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/__init__.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -804,7 +804,7 @@
         ui.warn(_("no known cache at %s\n") % cachepath)
         return
 
-    reposfile = open(repospath, 'r')
+    reposfile = open(repospath, 'rb')
     repos = set([r[:-1] for r in reposfile.readlines()])
     reposfile.close()
 
@@ -874,7 +874,7 @@
     # write list of valid repos back
     oldumask = os.umask(0o002)
     try:
-        reposfile = open(repospath, 'w')
+        reposfile = open(repospath, 'wb')
         reposfile.writelines([("%s\n" % r) for r in validrepos])
         reposfile.close()
     finally:



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


More information about the Mercurial-devel mailing list