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

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


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# 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)


More information about the Mercurial-devel mailing list