[PATCH] Python3 compatible modules - credentials, param, _glue

Stefan Metzmacher metze at samba.org
Mon Feb 20 15:21:55 UTC 2017

Am 20.02.2017 um 16:09 schrieb Stefan Metzmacher:
> Hi Andrew,
>> So we can at least have a public record of your thoughts (because I
>> respect them greatly) I would like to understand your reasoning here.
>> Why, in your view, is it important that we support RHEL6 with Samba 4.7
>> as an AD DC?  
> I'll have to check but there might be some SetNet customers using
> our packages on RHEL/CentOS 6.
>> I say as an AD DC, because I see an opportunity here to merge the --
>> disable-python patches at the same time, allowing the file server
>> production build to avoid python for now and so buy us some time.
>> Would your view change if the --disable-python patches were included?
> No, that won't help.
> My main point is that it is not reasonable for me to drop python 2.6
> support just because of the lack of PyCapsule!
> With our limited usage of PyCObject it should be easy to work around
> the python 2.6 limitations!
> Either like this
> https://lists.samba.org/archive/samba-technical/2017-February/118604.html
> or the following:
> Regarding pytalloc_CObject_FromTallocPtr() I think we need an improvement
> anyway, because pytalloc_CObject_FromTallocPtr is not a symmetric api.
> We can just leave it in place as it already is only available for python2.
> What we really want is something like this:
> PyObject *pytalloc_PointerObject_FromTallocPtr(const void *ptr);
> void *_pytalloc_PointerObject_AsTallocPtr(PyObject *self, const char *name);
> #define pytalloc_PointerObject_AsTallocPtr(self, type) \
> 	_pytalloc_PointerObject_AsTallocPtr(self, #type)
> int pytalloc_PointerObject_check(PyObject *self);
> int _pytalloc_PointerObject_checkType(Pyobject *self, type) \
> #define pytalloc_PointerObject_checkType(self, #type)
> pytalloc_PointerObject should be able to be based on pytalloc_BaseObject.

Instead we could also make it simpler by using pytalloc_BaseObject
directly, just:

  PyObject *pytalloc_BaseObject_FromTallocPtr(const void *ptr);

and make use of pytalloc_get_type() on the receiver side.

A useful addition would be:

  int _pytalloc_check_type(PyObject *py_obj, const char *type_name);
  #define pytalloc_check_type(py_obj, type) \
          _pytalloc_check_type(py_obj, #type);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170220/68d0c5f2/signature.sig>

More information about the samba-technical mailing list