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

Pulkit Goyal 7895pulkit at gmail.com
Mon Mar 27 02:18:41 EDT 2017


Yuya has a same one https://patchwork.mercurial-scm.org/patch/19680/

On Mon, Mar 27, 2017 at 4:06 AM, Augie Fackler <raf at durin42.com> wrote:

> # 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)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170327/5182e9e5/attachment.html>


More information about the Mercurial-devel mailing list