diff mercurial/cext/parsers.c @ 36619:1f8c3fadbb8e

py3: bulk-replace bytes format specifier passed to Py_BuildValue() On Python 3, "s" means a utf-8 string. We have to use "y" for bytes, sigh. https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue Substituted using the following pattern with some manual fixes: '\b(Py_BuildValue)\((\s*)"([^"]+)"'
author Yuya Nishihara <yuya@tcha.org>
date Sat, 03 Mar 2018 06:08:22 -0500
parents d13526333835
children 186c6df3a373
line wrap: on
line diff
--- a/mercurial/cext/parsers.c	Sat Mar 03 05:58:41 2018 -0500
+++ b/mercurial/cext/parsers.c	Sat Mar 03 06:08:22 2018 -0500
@@ -254,7 +254,7 @@
 		goto quit;
 	}
 
-	parents = Py_BuildValue("s#s#", str, 20, str + 20, 20);
+	parents = Py_BuildValue(PY23("s#s#", "y#y#"), str, 20, str + 20, 20);
 	if (!parents)
 		goto quit;