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

Stefan Metzmacher metze at samba.org
Mon Feb 20 15:09:16 UTC 2017

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
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.

With this in place we can convert all of our few users of PyCObject to this
and then we don't even need PyCapsule.

To summarize, as it seems to be easy to keep support for python 2.6
while making the code compatible with python 3, I'd really try to
avoid requiring python 2.7.


-------------- 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/eb82300a/signature.sig>

More information about the samba-technical mailing list