From: Douglas Bagnall Date: Mon, 2 Dec 2019 22:17:26 +0000 (+1300) Subject: pygpo: use correct method flags X-Git-Tag: samba-4.10.13~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edeed08a04c33e1bf77e6a4b6a24e739b60132bb;p=thirdparty%2Fsamba.git pygpo: use correct method flags The METH_KEYWORDS argument must always be combined with METH_VARARGS. In Python up to 3.7 this was checked at runtime, and as we had no callers to get_unix_path() in Python we never noticed. In Python 3.8 it is checked at import time, and everyone notices even if they aren't directly using GPOs. Found and reported by Val Kulkov. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14209 Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett (cherry picked from commit 12cccf3447333dfd4f5e437cd57ca5ec68724fdd) --- diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index 4db8cad7ca4..b8dfcd5572f 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -117,7 +117,7 @@ out: } static PyMethodDef GPO_methods[] = { - {"get_unix_path", (PyCFunction)py_gpo_get_unix_path, METH_KEYWORDS, + {"get_unix_path", (PyCFunction)py_gpo_get_unix_path, METH_VARARGS | METH_KEYWORDS, NULL }, {NULL} };