Index: Include/abstract.h =================================================================== --- Include/abstract.h (revision 83123) +++ Include/abstract.h (working copy) @@ -283,7 +283,7 @@ */ PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object, - char *format, ...); + const char *format, ...); /* Call a callable Python object, callable_object, with a @@ -295,8 +295,8 @@ */ - PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *method, - char *format, ...); + PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, const char *method, + const char *format, ...); /* Call the method named m of object o with a variable number of @@ -308,10 +308,10 @@ */ PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, - char *format, ...); + const char *format, ...); PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o, - char *name, - char *format, ...); + const char *name, + const char *format, ...); PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable, ...); Index: Objects/abstract.c =================================================================== --- Objects/abstract.c (revision 83123) +++ Objects/abstract.c (working copy) @@ -2186,7 +2186,7 @@ } PyObject * -PyObject_CallFunction(PyObject *callable, char *format, ...) +PyObject_CallFunction(PyObject *callable, const char *format, ...) { va_list va; PyObject *args; @@ -2206,7 +2206,7 @@ } PyObject * -_PyObject_CallFunction_SizeT(PyObject *callable, char *format, ...) +_PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...) { va_list va; PyObject *args; @@ -2226,7 +2226,7 @@ } PyObject * -PyObject_CallMethod(PyObject *o, char *name, char *format, ...) +PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...) { va_list va; PyObject *args; @@ -2265,7 +2265,7 @@ } PyObject * -_PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...) +_PyObject_CallMethod_SizeT(PyObject *o, const char *name, const char *format, ...) { va_list va; PyObject *args; Index: Doc/c-api/object.rst =================================================================== --- Doc/c-api/object.rst (revision 83123) +++ Doc/c-api/object.rst (working copy) @@ -208,7 +208,7 @@ of the Python expression ``callable_object(*args)``. -.. cfunction:: PyObject* PyObject_CallFunction(PyObject *callable, char *format, ...) +.. cfunction:: PyObject* PyObject_CallFunction(PyObject *callable, const char *format, ...) Call a callable Python object *callable*, with a variable number of C arguments. The C arguments are described using a :cfunc:`Py_BuildValue` style format @@ -218,9 +218,12 @@ pass :ctype:`PyObject \*` args, :cfunc:`PyObject_CallFunctionObjArgs` is a faster alternative. + .. versionchanged:: 3.2 + `format` was changed from ``char *`` -.. cfunction:: PyObject* PyObject_CallMethod(PyObject *o, char *method, char *format, ...) +.. cfunction:: PyObject* PyObject_CallMethod(PyObject *o, const char *method, const char *format, ...) + Call the method named *method* of object *o* with a variable number of C arguments. The C arguments are described by a :cfunc:`Py_BuildValue` format string that should produce a tuple. The format may be *NULL*, indicating that @@ -229,7 +232,10 @@ Note that if you only pass :ctype:`PyObject \*` args, :cfunc:`PyObject_CallMethodObjArgs` is a faster alternative. + .. versionchanged:: 3.2 + `method` and `format` were changed from ``char *`` + .. cfunction:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL) Call a callable Python object *callable*, with a variable number of