We reported an empty string:
"Invalid disk: "
Now the error is:
"Invalid disk: (PyObject_Repr failed)"
I think PyObject_Repr() fails because we abuse PyArg_ParseTuple() for
parsing disk tuple.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
python/sanlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index c481464..db8fb27 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -276,21 +276,21 @@ add_align_flag(long align, uint32_t *flags)
default:
PyErr_Format(PyExc_ValueError, "Invalid align value: %ld", align);
return -1;
}
return 0;
}
static void
set_error(PyObject* exception, const char* format, PyObject* obj)
{
- const char* str_rep = "";
+ const char* str_rep = "(PyObject_Repr failed)";
PyObject* rep = PyObject_Repr(obj);
if (rep)
str_rep = pystring_as_cstring(rep);
PyErr_Format(exception, format, str_rep);
Py_XDECREF(rep);
}
static PyObject *
hosts_to_list(struct sanlk_host *hss, int hss_count)
{
--
2.38.1