Code review comment for lp:~diane-trout/dkimpy/python3

Revision history for this message
Stuart Gathman (stuart-gathman) wrote :

Long ago, Nostradamus foresaw that on 03/20/2013 11:16 PM, Diane Trout
would write:
> Looks like the one I used was imported with:
>
> import DNS
>
> It appears the debian package is python3-dns with a homepage of
> http://launchpad.net/py3dns
>
> I'm guessing dns should probably return bytes by default?
>
> I read through https://en.wikipedia.org/wiki/Internationalized_domain_name and
> RFC 2181 which seem to indicate DNS can hold arbitrary binary strings and that
> individual records can specify their own encoding -- like punycode
> representation for non-ASCII domain names.
>
> So the "ideal" dns library might have some helper functions to decode specific
> resource records to unicode.
>
Yes, the unfinished goal for pydns is to have a "raw" value of bytes for
TXT, and "cooked" value of unicode. The default should be bytes (and I
screwed it up by adding some global options for decoding to unicode),
and we will be defining extensions for cooked values. Another screwy
thing is that A RRs are returned as dotted quad strings, whereas AAAA
RRs are returned as bytes. That is more difficult to rationalize
without breaking existing code. So that led to the idea of 3 modes:
raw, cooked, compat.

« Back to merge proposal