Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with python 3.7 #80

merged 3 commits into from Nov 6, 2019
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now


Fix compilation with python 3.7

_PyImport_FixupExtensionObject now takes four arguments.
The libpython library is now 2-digit versioned (at least on Debian), so
use -lpython3.7 not -lpython3 at link time.
The StringField class subclasses bytes, which needs a str() as its
Py_GetPath() and Py_GetProgramFullPath() return wide-char strings,
so use %ls when printing.
  • Loading branch information
wom-bat committed Nov 1, 2019
commit 8fb45feab94152a6aae3492aed4b81c363a912bd
@@ -156,7 +156,7 @@ class StringField(bytes):
disp_options = None

def __new__(self, value):
return bytes.__new__(self, value, "utf8")
return bytes.__new__(self, str(value), "utf-8")

def __init__(self, value):
self.value = value
@@ -853,7 +853,8 @@ PyObject *_apache_module_init()
m = PyModule_Create(&_apache_moduledef);
PyObject *name = PyUnicode_FromString("_apache");
_PyImport_FixupExtensionObject(m, name, name);
PyObject * modules = PyImport_GetModuleDict();
_PyImport_FixupExtensionObject(m, name, name, modules);
d = PyModule_GetDict(m);
Mp_ServerReturn = PyErr_NewException("_apache.SERVER_RETURN", NULL, NULL);
@@ -747,10 +747,10 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp,
"python_init: Python version mismatch, expected '%s', found '%s'.",
py_compile_version, py_dynamic_version);
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"python_init: Python executable found '%s'.",
"python_init: Python executable found '%ls'.",
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"python_init: Python path being used '%s'.",
"python_init: Python path being used '%ls'.",

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.