context: open files in bytes mode
authorAugie Fackler <augie@google.com>
Sat, 13 Oct 2018 08:54:31 -0400
changeset 40258 2f47703c5489
parent 40257 c3970be8deca
child 40259 5519697b71b3
context: open files in bytes mode I'm stunned this open() call has survived this long without the b in the mode - it seems like it should have been a source of bugs somewhere... Differential Revision: https://phab.mercurial-scm.org/D5080
mercurial/context.py
--- a/mercurial/context.py	Sat Oct 13 09:45:49 2018 -0400
+++ b/mercurial/context.py	Sat Oct 13 08:54:31 2018 -0400
@@ -2433,5 +2433,5 @@
 
     def write(self, data, flags, **kwargs):
         assert not flags
-        with open(self._path, "w") as f:
+        with open(self._path, "wb") as f:
             f.write(data)