[PATCHES] Port ldb to Python 3

Petr Viktorin pviktori at redhat.com
Thu Aug 13 12:52:02 UTC 2015


On 08/12/2015 10:53 PM, Stefan Metzmacher wrote:
> Hi Petr,
> 
>>>>>> When creating DNs and attribute values, both text and bytes are 
>>>>>> acepted.
>>>>>> This allows creating messages from homogeneous dicts (where 
>>>>>> values and
>>>>>> "dn" are all either text or bytes).
>>>>>>
>>>>>> Similarly to the tdb bindings, LDB Messages and MessageElements 
>>>>>> have a
>>>>>> .text attribute, which offers a text view on the contents: any 
>>>>>> value
>>>>>> retrieved from it will be decoded using UTF-8. The wrapper is
>>>>>> implemented in a new Python module.
>>>>>>
>>>>>>
>>>>>> -- Petr Viktorin
>>>>>>
>>>>>> From c65e8f315077a0a0fef3f9cf164850ce6d813951 Mon Sep 17 
>>>>>> 00:00:00 2001
>>>>>> From: Petr Viktorin <pviktori at redhat.com>
>>>>>> Date: Tue, 9 Jun 2015 10:31:22 +0200
>>>>>> Subject: [PATCH 2/9] ldb: Build for two Python versions at once
>>>>>
>>>>> Shouldn't that be the last patch? I guess this will only
>>>>> work after all the other fixes.
>>>>
>>>> Well, having this in first made it possible to work on the porting
>>>> patches. It doesn't break things, because you still need to 
>>>> configure
>>>> with --extrapython=python3 to enable this.
>>>>
>>>> You can reorder the patches and apply this at the end; it doesn't
>>>> conflict with the others.
>>>>
>>>>> Other than that I'm happy with the changes.
>>>>
>>>> Thanks for reviewing!
>>>
>>>
>>> Hello,
>>> Anything I can do to help push this forward?
>>
>> Not really, and I do appreciate your patience.  I've just not had a
>> chance to look over it in detail yet.
> 
> I've reviewed most of the patches see
> https://git.samba.org/?p=metze/samba/wip.git;a=shortlog;h=refs/heads/master3-python
> 
> I have just a couple of questions.
> 
> This one needs to be squashed
> https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=985f384e1fe3d998c032eb17f01d991ea33fdbfb
> into
> https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=b8aaa4a020d6d36972fdf6fb33d762b9321699a7
> otherwise the build with --picky-developer fails.

Thanks; I'll need to enable that option for my builds.

> I've added some TODO's here:
> https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=5e00a20e55baa3f83d69bf0dc9280527a3af7ae1
> 
> As I'm trying to use --extra-python=/usr/bin/python3 on ubuntu 14.04
> 
> I've got the following when trying to bump the ldb version.
> 
> https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=0604992f1a185557102881e4837bef291696053e
> 
> A pyldb-util.cpython-34m-1.1.22.sigs is generated, the question would
> how can we have just
> one pyldb-util-1.1.22.sigs that is checked for both versions or we need
> a python2 and a python3 file. But that should not depend an the exact
> python3 version.

I can see if I can convince the buildsystem to replace the
".cpython-34m" with something like ".py3".
That would affect pytalloc, pytdb, pytevent as well, so I see it as
orthogonal to these particular patches.

In talloc, pytalloc_CObject_FromTallocPtr is not available for Python 3
(and if a replacement is re-added, it would need a different name). So,
one file for both Pythons won't work.

As for the ABI itself, it *is* tied to the exact Python version, even
for py2 (unless we'd switch to only use Python's stable ABI subset, but
that's not available for py2). I guess that doesn't matter for the
signatures file, though.

-- 
Petr Viktorin




More information about the samba-technical mailing list