<p>The following patch resolves the app_python3 build errors (Which are changes with Python 3.7).  Fedora 29 includes Python 3.7 released on 06/27/2018.</p>
<pre><code>diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c
index fcc42fa89..00f7e2ced 100644
--- a/src/modules/app_python3/app_python3_mod.c
+++ b/src/modules/app_python3/app_python3_mod.c
@@ -177,7 +177,7 @@ static int child_init(int rank)
                return 0;
        }
        _apy_process_rank = rank;
-       PyOS_AfterFork();
+       PyOS_AfterFork_Child();
        if (cfg_child_init()) {
                return -1;
        }
@@ -431,7 +431,7 @@ int apy_init_script(int rank)
 {
        PyObject *pFunc, *pArgs, *pValue, *pResult;
        int rval = -1;
-       char *classname;
+       const char *classname;
        PyGILState_STATE gstate;
 
 
diff --git a/src/modules/app_python3/python_support.c b/src/modules/app_python3/python_support.c
index e7dc47d52..14ba3283f 100644
--- a/src/modules/app_python3/python_support.c
+++ b/src/modules/app_python3/python_support.c
@@ -234,10 +234,10 @@ static char *make_message(const char *fmt, va_list ap)
        return NULL;    // shall not happened, but who knows ;)
 }
 
-char *get_class_name(PyObject *y)
+const char *get_class_name(PyObject *y)
 {
        PyObject *p;
-       char *name;
+       const char *name;
 
        p = PyObject_GetAttrString(y, "__name__");
        if (p == NULL || p == Py_None)
@@ -253,10 +253,10 @@ char *get_class_name(PyObject *y)
 }
 
 
-char *get_instance_class_name(PyObject *y)
+const char *get_instance_class_name(PyObject *y)
 {
        PyObject *p, *n;
-       char *name;
+       const char *name;
 
        n = PyObject_GetAttrString(y, "__class__");
        if (n == NULL || n == Py_None)
diff --git a/src/modules/app_python3/python_support.h b/src/modules/app_python3/python_support.h
index 4d2556411..b3823da76 100644
--- a/src/modules/app_python3/python_support.h
+++ b/src/modules/app_python3/python_support.h
@@ -30,7 +30,7 @@ PyObject *format_exc_obj;
 void python_handle_exception(const char *, ...);
 
 PyObject *InitTracebackModule(void);
-char *get_class_name(PyObject *);
-char *get_instance_class_name(PyObject *);
+const char *get_class_name(PyObject *);
+const char *get_instance_class_name(PyObject *);
 
 #endif
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1748#issuecomment-443454407">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTszfa2naw1EWBgpEZtGJe-pWv9pks5u0uDtgaJpZM4Y8-74">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Za5zA7JqaEG2Ga47UW_XV3H1Jbvtks5u0uDtgaJpZM4Y8-74.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@amessina in #1748: The following patch resolves the app_python3 build errors (Which are changes with Python 3.7).  Fedora 29 includes Python 3.7 released on 06/27/2018.\r\n```\r\ndiff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c\r\nindex fcc42fa89..00f7e2ced 100644\r\n--- a/src/modules/app_python3/app_python3_mod.c\r\n+++ b/src/modules/app_python3/app_python3_mod.c\r\n@@ -177,7 +177,7 @@ static int child_init(int rank)\r\n \t\treturn 0;\r\n \t}\r\n \t_apy_process_rank = rank;\r\n-\tPyOS_AfterFork();\r\n+\tPyOS_AfterFork_Child();\r\n \tif (cfg_child_init()) {\r\n \t\treturn -1;\r\n \t}\r\n@@ -431,7 +431,7 @@ int apy_init_script(int rank)\r\n {\r\n \tPyObject *pFunc, *pArgs, *pValue, *pResult;\r\n \tint rval = -1;\r\n-\tchar *classname;\r\n+\tconst char *classname;\r\n \tPyGILState_STATE gstate;\r\n \r\n \r\ndiff --git a/src/modules/app_python3/python_support.c b/src/modules/app_python3/python_support.c\r\nindex e7dc47d52..14ba3283f 100644\r\n--- a/src/modules/app_python3/python_support.c\r\n+++ b/src/modules/app_python3/python_support.c\r\n@@ -234,10 +234,10 @@ static char *make_message(const char *fmt, va_list ap)\r\n \treturn NULL;\t// shall not happened, but who knows ;)\r\n }\r\n \r\n-char *get_class_name(PyObject *y)\r\n+const char *get_class_name(PyObject *y)\r\n {\r\n \tPyObject *p;\r\n-\tchar *name;\r\n+\tconst char *name;\r\n \r\n \tp = PyObject_GetAttrString(y, \"__name__\");\r\n \tif (p == NULL || p == Py_None)\r\n@@ -253,10 +253,10 @@ char *get_class_name(PyObject *y)\r\n }\r\n \r\n \r\n-char *get_instance_class_name(PyObject *y)\r\n+const char *get_instance_class_name(PyObject *y)\r\n {\r\n \tPyObject *p, *n;\r\n-\tchar *name;\r\n+\tconst char *name;\r\n \r\n \tn = PyObject_GetAttrString(y, \"__class__\");\r\n \tif (n == NULL || n == Py_None)\r\ndiff --git a/src/modules/app_python3/python_support.h b/src/modules/app_python3/python_support.h\r\nindex 4d2556411..b3823da76 100644\r\n--- a/src/modules/app_python3/python_support.h\r\n+++ b/src/modules/app_python3/python_support.h\r\n@@ -30,7 +30,7 @@ PyObject *format_exc_obj;\r\n void python_handle_exception(const char *, ...);\r\n \r\n PyObject *InitTracebackModule(void);\r\n-char *get_class_name(PyObject *);\r\n-char *get_instance_class_name(PyObject *);\r\n+const char *get_class_name(PyObject *);\r\n+const char *get_instance_class_name(PyObject *);\r\n \r\n #endif\r\n```\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1748#issuecomment-443454407"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1748#issuecomment-443454407",
"url": "https://github.com/kamailio/kamailio/issues/1748#issuecomment-443454407",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] [Feature Request] Fix Python 2 \u0026 3 build warnings (#1748)",
"sections": [
{
"text": "",
"activityTitle": "**Anthony Messina**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@amessina",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1748,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1748\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1748#issuecomment-443454407"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 418639608\n}"
}
],
"themeColor": "26292E"
}
]</script>