From: Alan T. DeKok Date: Wed, 12 Mar 2025 04:31:08 +0000 (+0200) Subject: Py_GetPath is deprecated and will be remove. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d63436f22f935a5e25224cf5e00a023c35d2ec0c;p=thirdparty%2Ffreeradius-server.git Py_GetPath is deprecated and will be remove. People can just print sys.path if they need to see what it is It would be nice for the python API documentation to help here. It says Py_GetPath is deprecated, and to look at sys.path instead. But it doesn't say how to get sys.path from the API. A quick look around shows how to get sys.path from the Python code, but not from the API. Instead of doing the right thing, we just remove the deprecated code. --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 764dbff7448..f574f95662f 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -1098,7 +1098,6 @@ static int libpython_init(void) PyConfig config; PyStatus status; wchar_t *wide_name; - char *path; fr_assert(!Py_IsInitialized()); @@ -1166,13 +1165,6 @@ static int libpython_init(void) PyConfig_Clear(&config); - /* - * Report the path - */ - path = Py_EncodeLocale(Py_GetPath(), NULL); - LOAD_INFO("Python path set to \"%s\"", path); - PyMem_Free(path); - global_interpreter = PyEval_SaveThread(); /* Store reference to the main interpreter and release the GIL */ return 0;