diff --git a/mercurial/cext/pathencode.c b/mercurial/cext/pathencode.c --- a/mercurial/cext/pathencode.c +++ b/mercurial/cext/pathencode.c @@ -678,7 +678,7 @@ } } - shaobj = PyObject_CallFunction(shafunc, "s#", str, len); + shaobj = PyObject_CallFunction(shafunc, PY23("s#", "y#"), str, len); if (shaobj == NULL) return -1;