Mercurial > hg
diff mercurial/cext/pathencode.c @ 36620:186c6df3a373
py3: bulk-replace 'const char*' format specifier passed to PyArg_ParseTuple*()
Perhaps we need this because 's' accepts a unicode string.
https://docs.python.org/3/c-api/arg.html#strings-and-buffers
Substituted using the following pattern with some manual fixes:
'\b(PyArg_ParseTuple)\((\s*\w+,\s*)"([^"]+)"'
'\b(PyArg_ParseTupleAndKeywords)\((\s*\w+,\s*\w+,\s*)"([^"]+)"'
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 06:18:47 -0500 |
parents | 44cb058bc0d3 |
children | 92ac9cf78dba |
line wrap: on
line diff
--- a/mercurial/cext/pathencode.c Sat Mar 03 06:08:22 2018 -0500 +++ b/mercurial/cext/pathencode.c Sat Mar 03 06:18:47 2018 -0500 @@ -512,7 +512,8 @@ Py_ssize_t len, newlen; PyObject *ret; - if (!PyArg_ParseTuple(args, "s#:lowerencode", &path, &len)) + if (!PyArg_ParseTuple(args, PY23("s#:lowerencode", "y#:lowerencode"), + &path, &len)) return NULL; newlen = _lowerencode(NULL, 0, path, len);