[ldns-users] adding (partial) Python3 support

W.C.A. Wijngaards wouter at NLnetLabs.nl
Fri Aug 19 13:29:45 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Karel,

The patch from your previous email is applied to svn trunk.
The sitepackage path is still lib64, I see.

I think feedback was very good.  The FILE* support could be nice to have
as well.

Best regards,
   Wouter

On 08/19/2011 03:08 PM, Karel Slany wrote:
> 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
> 
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOTmVJAAoJEJ9vHC1+BF+NAzgP/2BwsfW5znq+HsPiUFUdhIj9
2jeSblFgkPiF3Tglrl0AMMrdro7bj22R/+TUbwDjrg4DiLRPLi6BLFBRBi82v4k2
Fx2iV4F44I0aFrGup0XLPr6uK6xdnHCUMUucg55r4leRNztsNzwg7R7ciT32nLOh
RfdFVIshzH9rArDEoUKsWi44y6czTw5oZEKJ9uzKZHQ+ogYy/Sz0hgwI3d5+QN1E
ZEM4QIV0ipYVLCx7P5sIwUYVO7CBnyEHRJqnKcYCHMTcmeyVhs0TERjoEOzSm3mD
QN1kp8ArS/W1axfPowXMuLkcQML6yszpu4SR4P8nM7nfj/BZVUp7GMWhpCAKEtBX
0dY9rT8x8U5fkbKcgPCtbdh2kpX2vPw2gCU6kMA2hbp2lYWkE7ZDjIyUqDq+a3GT
E89SRq89gKYGCSipu8uyndq4sm6btSCH1hE7ZEzqgXD2Uk/SWt3hipIIhIHabE9V
hZfSWbPCWjaBBmJ5F5w08JmhdXsauqInRqkMTskp4Za1j6Itt8XxktqgzXhmPRR8
NlYFtNVadrGLU6qwwBNidJAdNmQ86DLiAjkJAAwf0FvPklk+sJA3ssdYzXV7vihi
siDVof6jqhv3tQXMPGawvrcVJNMTJn1YoAVXrZPzptBsXt0Sik7TmRbyaU+J9Myl
9J4wAi8NeLMrzC5QxK5y
=Dyid
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list