[PATCH 04 of 11] changelog: coerce data to write to bytes(), not str()

Augie Fackler raf at durin42.com
Sun Mar 26 18:36:38 EDT 2017


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1490567095 14400
#      Sun Mar 26 18:24:55 2017 -0400
# Node ID 54631fab906cb662e370ce313a0395292f7dfa15
# Parent  25355685cfaced26214c1fb89d191c3705dc52c7
changelog: coerce data to write to bytes(), not str()

I'm pretty sure we never get an int in here, so this should be safe.

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -120,7 +120,7 @@ class appender(object):
         return ret
 
     def write(self, s):
-        self.data.append(str(s))
+        self.data.append(bytes(s))
         self.offset += len(s)
         self._end += len(s)
 


More information about the Mercurial-devel mailing list