Re: [PATCH 06 of 11] bdiff: coerce to bytes() not str() in pure code

2017-03-27 Thread Pulkit Goyal
Yuya also has couple of patches in his series which deal with the same
issue.
https://patchwork.mercurial-scm.org/patch/19678/
https://patchwork.mercurial-scm.org/patch/19679/


On Mon, Mar 27, 2017 at 4:06 AM, Augie Fackler  wrote:

> # HG changeset patch
> # User Augie Fackler 
> # Date 1490567279 14400
> #  Sun Mar 26 18:27:59 2017 -0400
> # Node ID 48144fe2d912b7d9fc300955d0c881aceead6930
> # Parent  d5dcfa6b2e20183ba2d6e439a23f5f2f4bf7981e
> bdiff: coerce to bytes() not str() in pure code
>
> diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
> --- a/mercurial/pure/bdiff.py
> +++ b/mercurial/pure/bdiff.py
> @@ -59,7 +59,7 @@ def _tostring(c):
>  if type(c) is array.array:
>  # this copy overhead isn't ideal
>  return c.tostring()
> -return str(c)
> +return bytes(c)
>
>  def bdiff(a, b):
>  a = _tostring(a).splitlines(True)
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 06 of 11] bdiff: coerce to bytes() not str() in pure code

2017-03-26 Thread Augie Fackler
# HG changeset patch
# User Augie Fackler 
# Date 1490567279 14400
#  Sun Mar 26 18:27:59 2017 -0400
# Node ID 48144fe2d912b7d9fc300955d0c881aceead6930
# Parent  d5dcfa6b2e20183ba2d6e439a23f5f2f4bf7981e
bdiff: coerce to bytes() not str() in pure code

diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
--- a/mercurial/pure/bdiff.py
+++ b/mercurial/pure/bdiff.py
@@ -59,7 +59,7 @@ def _tostring(c):
 if type(c) is array.array:
 # this copy overhead isn't ideal
 return c.tostring()
-return str(c)
+return bytes(c)
 
 def bdiff(a, b):
 a = _tostring(a).splitlines(True)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel