hgext/remotefilelog/basestore.py
changeset 40614 aa588bf40a08
parent 40610 13d4ad8d7801
child 40841 ad21fbcb1ba5
--- a/hgext/remotefilelog/basestore.py	Tue Nov 13 18:08:17 2018 +0300
+++ b/hgext/remotefilelog/basestore.py	Tue Nov 13 18:08:55 2018 +0300
@@ -255,7 +255,7 @@
         they want to be kept alive in the store.
         """
         repospath = os.path.join(self._path, "repos")
-        with open(repospath, 'a') as reposfile:
+        with open(repospath, 'ab') as reposfile:
             reposfile.write(os.path.dirname(path) + "\n")
 
         repospathstat = os.stat(repospath)
@@ -270,7 +270,7 @@
             return True
 
         if self._validatecachelog:
-            with open(self._validatecachelog, 'a+') as f:
+            with open(self._validatecachelog, 'ab+') as f:
                 f.write("corrupt %s during %s\n" % (path, action))
 
         os.rename(path, path + ".corrupt")