diff hgext/convert/common.py @ 36132:42a393ea56d2

convert: open all files in binary mode Differential Revision: https://phab.mercurial-scm.org/D2220
author Augie Fackler <augie@google.com>
date Mon, 12 Feb 2018 23:50:58 -0500
parents 671aba341d90
children 0f9e52f900c4
line wrap: on
line diff
--- a/hgext/convert/common.py	Mon Feb 12 22:29:36 2018 -0500
+++ b/hgext/convert/common.py	Mon Feb 12 23:50:58 2018 -0500
@@ -447,7 +447,7 @@
         if not self.path:
             return
         try:
-            fp = open(self.path, 'r')
+            fp = open(self.path, 'rb')
         except IOError as err:
             if err.errno != errno.ENOENT:
                 raise
@@ -471,7 +471,7 @@
     def __setitem__(self, key, value):
         if self.fp is None:
             try:
-                self.fp = open(self.path, 'a')
+                self.fp = open(self.path, 'ab')
             except IOError as err:
                 raise error.Abort(
                     _('could not open map file %r: %s') %