注册

在ubuntu22.04上编译DM的Python驱动时出现错误:listobject.h:33:36: error: void value not ignored as it ought to be

罗昊 2022/07/06 75 0

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】 :v8
【操作系统】:Ubuntu 22.04
【CPU】: Intel
【问题描述】:
运行 python3 setup.py install 编译DM的Python驱动时出现如下错误
177259791405924e0b64f46868caa02f11c78cc6d.png

对应的代码是:

static 
sdint2
Cursor_SetColVariables(udt_Cursor*   self)
{
 udint2          icol;
 udt_Variable*   udt_var;

if ((int)self->arraySize < 0 || self->arraySize > ULENGTH_MAX)
{
    PyErr_SetString(g_ErrorException, "Invalid cursor arraysize\n");
    return -1;
}

Py_CLEAR(self->col_variables);

self->col_variables = PyList_New(self->colCount);
if (self->col_variables == NULL)
{
    if (!PyErr_Occurred())
        PyErr_NoMemory();

    return -1;
}

for (icol = 0; icol < self->colCount; icol ++)
{
    udt_var = Variable_Define(self, self->hdesc_col, icol + 1, (udint4)self->arraySize);
    if (udt_var == NULL)
        return -1;

    if (PyList_SET_ITEM(self->col_variables, icol, (PyObject*)udt_var) < 0)//-------------------------------this line caused problem
        return -1;
}

self->org_bindArraySize = self->bindArraySize;

return 0;

}

一开始我怀疑是cython的问题,到cython的官方论坛去提了bug:

github.com/cython/cython/issues/4873

他们回答:

This definitely isn’t Cython-generated code so it isn’t a Cython bug. I suggested a possible fix on your CPython issue, but this is a bug in Cursor.c

当前的python 版本是 python3.10.4,请帮忙看下这否是DM驱动的Bug.

回答 0
暂无回答
扫一扫
联系客服