]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Improvements to dns.rdata.to_wire(). 499/head
authorBrian Wellington <bwelling@xbill.org>
Mon, 1 Jun 2020 18:32:03 +0000 (11:32 -0700)
committerBrian Wellington <bwelling@xbill.org>
Mon, 1 Jun 2020 18:32:03 +0000 (11:32 -0700)
commitc6c0041169f4888ffd96e7ca3d69c8ed351b8cb0
tree5684f461ae86c698cbefcdf0b8213f7074d19c81
parent8b687180391afc37c59eb57ae0fc5a77a2d894cc
Improvements to dns.rdata.to_wire().

This does two things.

1) Makes the file parameter optional, removing the requirement that
callers create an io.BytesIO object if all they want is the bytes.  This
is done by renaming all of the rdata subclass to_wire() methods to
_to_wire(), and making dns.rdata.to_wire() create the io.BytesIO
internally if needed, and then delegate to the subclass.

2) Add canonicalize=False parameter, allowing code reuse for conversion
to wire format and conversion to hashable format.  This also removes all
of the rdata subclass to_digestable routines that are no longer needed,
as dns.rdata.to_digestable will work for all rdata types.
44 files changed:
dns/dnssec.py
dns/name.py
dns/name.pyi
dns/rdata.py
dns/rdata.pyi
dns/rdtypes/ANY/CAA.py
dns/rdtypes/ANY/CERT.py
dns/rdtypes/ANY/CSYNC.py
dns/rdtypes/ANY/DNAME.py
dns/rdtypes/ANY/GPOS.py
dns/rdtypes/ANY/HINFO.py
dns/rdtypes/ANY/HIP.py
dns/rdtypes/ANY/ISDN.py
dns/rdtypes/ANY/LOC.py
dns/rdtypes/ANY/NSEC.py
dns/rdtypes/ANY/NSEC3.py
dns/rdtypes/ANY/NSEC3PARAM.py
dns/rdtypes/ANY/OPENPGPKEY.py
dns/rdtypes/ANY/RP.py
dns/rdtypes/ANY/RRSIG.py
dns/rdtypes/ANY/SOA.py
dns/rdtypes/ANY/SSHFP.py
dns/rdtypes/ANY/TLSA.py
dns/rdtypes/ANY/URI.py
dns/rdtypes/ANY/X25.py
dns/rdtypes/CH/A.py
dns/rdtypes/IN/A.py
dns/rdtypes/IN/AAAA.py
dns/rdtypes/IN/APL.py
dns/rdtypes/IN/DHCID.py
dns/rdtypes/IN/IPSECKEY.py
dns/rdtypes/IN/NAPTR.py
dns/rdtypes/IN/NSAP.py
dns/rdtypes/IN/PX.py
dns/rdtypes/IN/SRV.py
dns/rdtypes/IN/WKS.py
dns/rdtypes/dnskeybase.py
dns/rdtypes/dnskeybase.pyi
dns/rdtypes/dsbase.py
dns/rdtypes/euibase.py
dns/rdtypes/mxbase.py
dns/rdtypes/nsbase.py
dns/rdtypes/txtbase.py
tests/test_rdtypeanyeui.py