Patchwork [3,of,7] py3: use bytes() to cast to immutable bytes in changelog.appender.write()

login
register
mail settings
Submitter Yuya Nishihara
Date March 26, 2017, 11:59 a.m.
Message ID <ea2d8321f3209e5b8173.1490529586@mimosa>
Download mbox | patch
Permalink /patch/19680/
State Accepted
Headers show

Comments

Yuya Nishihara - March 26, 2017, 11:59 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1490513461 -32400
#      Sun Mar 26 16:31:01 2017 +0900
# Node ID ea2d8321f3209e5b817353e2e15f7ba6b1b472a5
# Parent  662b30cb4977b4f6fcf56e768ef1c7c5da8e8adc
py3: use bytes() to cast to immutable bytes in changelog.appender.write()

Patch

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)