Index: Python/sysmodule.c =================================================================== --- Python/sysmodule.c (revision 67215) +++ Python/sysmodule.c (working copy) @@ -47,7 +47,7 @@ #endif PyObject * -PySys_GetObject(char *name) +PySys_GetObject(const char *name) { PyThreadState *tstate = PyThreadState_GET(); PyObject *sd = tstate->interp->sysdict; @@ -57,7 +57,7 @@ } FILE * -PySys_GetFile(char *name, FILE *def) +PySys_GetFile(const char *name, FILE *def) { FILE *fp = NULL; PyObject *v = PySys_GetObject(name); @@ -69,7 +69,7 @@ } int -PySys_SetObject(char *name, PyObject *v) +PySys_SetObject(const char *name, PyObject *v) { PyThreadState *tstate = PyThreadState_GET(); PyObject *sd = tstate->interp->sysdict; @@ -973,7 +973,7 @@ } void -PySys_AddWarnOption(char *s) +PySys_AddWarnOption(const char *s) { PyObject *str; @@ -1437,10 +1437,10 @@ } static PyObject * -makepathobject(char *path, int delim) +makepathobject(const char *path, int delim) { int i, n; - char *p; + const char *p; PyObject *v, *w; n = 1; @@ -1470,7 +1470,7 @@ } void -PySys_SetPath(char *path) +PySys_SetPath(const char *path) { PyObject *v; if ((v = makepathobject(path, DELIM)) == NULL) @@ -1648,7 +1648,7 @@ */ static void -mywrite(char *name, FILE *fp, const char *format, va_list va) +mywrite(const char *name, FILE *fp, const char *format, va_list va) { PyObject *file; PyObject *error_type, *error_value, *error_traceback; Index: Include/sysmodule.h =================================================================== --- Include/sysmodule.h (revision 67215) +++ Include/sysmodule.h (working copy) @@ -7,11 +7,11 @@ extern "C" { #endif -PyAPI_FUNC(PyObject *) PySys_GetObject(char *); -PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); -PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); +PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); +PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); +PyAPI_FUNC(FILE *) PySys_GetFile(const char *, FILE *); PyAPI_FUNC(void) PySys_SetArgv(int, char **); -PyAPI_FUNC(void) PySys_SetPath(char *); +PyAPI_FUNC(void) PySys_SetPath(const char *); PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); @@ -22,7 +22,7 @@ PyAPI_DATA(int) _PySys_CheckInterval; PyAPI_FUNC(void) PySys_ResetWarnOptions(void); -PyAPI_FUNC(void) PySys_AddWarnOption(char *); +PyAPI_FUNC(void) PySys_AddWarnOption(const char *); PyAPI_FUNC(int) PySys_HasWarnOptions(void); #ifdef __cplusplus Index: Doc/c-api/sys.rst =================================================================== --- Doc/c-api/sys.rst (revision 67215) +++ Doc/c-api/sys.rst (working copy) @@ -63,18 +63,18 @@ accessible to C code. They all work with the current interpreter thread's :mod:`sys` module's dict, which is contained in the internal thread state structure. -.. cfunction:: PyObject *PySys_GetObject(char *name) +.. cfunction:: PyObject *PySys_GetObject(const char *name) Return the object *name* from the :mod:`sys` module or *NULL* if it does not exist, without setting an exception. -.. cfunction:: FILE *PySys_GetFile(char *name, FILE *def) +.. cfunction:: FILE *PySys_GetFile(const char *name, FILE *def) Return the :ctype:`FILE*` associated with the object *name* in the :mod:`sys` module, or *def* if *name* is not in the module or is not associated with a :ctype:`FILE*`. -.. cfunction:: int PySys_SetObject(char *name, PyObject *v) +.. cfunction:: int PySys_SetObject(const char *name, PyObject *v) Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` @@ -84,11 +84,11 @@ Reset :data:`sys.warnoptions` to an empty list. -.. cfunction:: void PySys_AddWarnOption(char *s) +.. cfunction:: void PySys_AddWarnOption(const char *s) Append *s* to :data:`sys.warnoptions`. -.. cfunction:: void PySys_SetPath(char *path) +.. cfunction:: void PySys_SetPath(const char *path) Set :data:`sys.path` to a list object of paths found in *path* which should be a list of paths separated with the platform's search path delimiter