Running into a problem with PyArg_ParseTuple ...

Jelmer Vernooij jelmer at samba.org
Sun Mar 25 15:15:24 MDT 2012


On Sun, Mar 25, 2012 at 10:31:42AM -0700, Richard Sharpe wrote:
> Hi folks,

> I have tried to modify py_smb_getacl thusly:

> -static PyObject *py_smb_getacl(pytalloc_Object *self, PyObject *args, PyObject
> +static PyObject *py_smb_getacl(pytalloc_Object *self, PyObject *args)
>  {
^^ What kind of change is this? It seems like the line isn't wrapped
properly?

>         NTSTATUS status;
>         union smb_open io;
>         union smb_fileinfo fio;
>         struct smb_private_data *spdata;
>         const char *filename;
> +       int sinfo = 0;
>         int fnum;

> -       if (!PyArg_ParseTuple(args, "s:get_acl", &filename)) {
> +       if (!PyArg_ParseTuple(args, "sl:get_acl", &filename, &sinfo)) {
>                 return NULL;
>         }
You want "si" here rather than "sl" if sinfo is an "int".

See also http://docs.python.org/c-api/arg.html

Cheers,

Jelmer



More information about the samba-technical mailing list