Kaydet (Commit) d8232222 authored tarafından Ozan Çağlayan's avatar Ozan Çağlayan

Fix a segfault within the Python interpreter. The segfault happens on some rare

_({}) usages for error messages in COMAR scripts. Incrementing reference on the
returned dictionary value fixed the problem at least on my setup.
üst c6b8cb38
......@@ -332,6 +332,7 @@ static PyObject *
c_i18n(PyObject *self, PyObject *args)
PyObject *py_dict;
PyObject *py_value;
if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &py_dict)) {
return NULL;
......@@ -343,10 +344,12 @@ c_i18n(PyObject *self, PyObject *args)
if (PyDict_Contains(py_dict, py_lang)) {
return PyDict_GetItem(py_dict, py_lang);
py_value = PyDict_GetItem(py_dict, py_lang);
return py_value;
else {
PyErr_Format(PyExc_COMAR_Script, "Script is lack of default ('en') locale string.");
PyErr_Format(PyExc_COMAR_Script, "'en' locale string should be provided by default in COMAR scripts.");
return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment