[ldns-users] adding (partial) Python3 support

Karel Slany karel.slany at nic.cz
Fri Aug 19 13:08:39 UTC 2011


Hi Wouter,

as far as I know the proposed patches do not break Python2
compatibility. I've tested python 2.4, 2.6 and 2.7.

I would really appreciate the patches to be applied in the SVN tree as
soon as possible. Particularly for the following reasons:

* During the last few days I've written some experimental code enabling
FILE* support in Python3.
(This enables full Python3 wrapper functionality, at least in the means
of its current functionality -- see next reason. The support code may
not be extremely fast, but in my opinion, it is reliable enough to serve
as a initial working solution for Python3 on GNU/Linux.)

* The current ldns swig wrapper generator source appears to be somewhat
buggy. This may be partially caused by the evolution of the ldns C
source whereas the changes weren't reflected in the wrapper code. The
ldns_axfr_start patch may be one example. Another is the malfunctioning
ldns-signzone.py python example. Whereas the LDNS_DEBUG define in ldns.i
breaks the wrapper code when used instead of producing additional useful
debugging info.

It would be really nice to apply these patches as soon as possible
because I'm also a bit sceptical about getting some serious (meaning
lots of) feedback in this thread.

It would be also nice to consider expanding the set of examples to serve
as basic functionality test for the pyldns. This may help to avoid
unintentional breaking of compatibility.

Best regards,
K.

Dne 16.8.2011 13:46, Bedrich Kosata napsal(a):
> Hi,
> 
> I tried both the patches and can confirm that it fixes the AXFR example
> crash and that it compiles and works properly with Python 2.6.
> I did not test it in Python 3, but it does not break 2.6. :)
> 
> Cheers
> 
> Beda
> 
> On 08/16/2011 11:50 AM, W.C.A. Wijngaards wrote:
> Hi Karel,
> 
> On 08/15/2011 04:24 PM, Karel Slany wrote:
>>>> recently I have been toying with the ldns sources in order to make them
>>>> compile with Python3 support -- via the './configure --with-pyldns
>>>> PYTHON_VERSION=3' command. I've made several changes to the supplied
>>>> autoconf Python detection macros and others to make them work both with
>>>> Python 2 and 3.
> 
> Because we do not maintain these python implementations ourselves, it
> would be good if other users could tell us if these patches work for
> Python 2.  There are large changes, and we want to support our users.
> 
> If that works, the patch is likely very nice to accept.  Thanks for the
> good work :-)
> 
> Best regards,
>     Wouter
> 
>>>> The Python3 wrapper does now compile. However, the Python3 support is
>>>> incomplete. In Python3 they have abandoned the old C I/O API in favour
>>>> of the io module. Therefore SWIG does no longer support FILE* typemaps
>>>> -- i.e. C functions taking FILE* arguments will generate an error in
>>>> Python3.
>>>>
>>>> This mail contains two patches:
>>>> 1) python3.diff -- Contains modifications enabling the Python3 module to
>>>> compile and to run with Python3. It also contains a few working examples
>>>> for Python3 which do the same as the original Python2 examples.
>>>>
>>>> 2)ldns_axfr_start.diff -- As I discovered, the ldns-axf example did not
>>>> work -- this patch should fix it.
>>>>
>>>> The patches are against the 3523 (current) svn revision.
>>>>
>>>> Best regard
>>>>
>>>> Karel Slany
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ldns-users mailing list
>>>> ldns-users at open.nlnetlabs.nl
>>>> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users
> 
_______________________________________________
ldns-users mailing list
ldns-users at open.nlnetlabs.nl
http://open.nlnetlabs.nl/mailman/listinfo/ldns-users




More information about the ldns-users mailing list