]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Fix dns.rdatatype special cases. 822/head
authorBrian Wellington <bwelling@xbill.org>
Fri, 15 Jul 2022 16:01:17 +0000 (09:01 -0700)
committerBrian Wellington <bwelling@xbill.org>
Fri, 15 Jul 2022 16:01:17 +0000 (09:01 -0700)
commit8a10f7b9b28950a60ae452f019268ca9a4306f5a
tree71cc30b2babc8b050cdea0fd2f0a928bc568590a
parent759421d3e9add44fb5aecf3bac2939ef6bc85b59
Fix dns.rdatatype special cases.

Prior to this change, there was logic in dns.rdatatype.from_text() and
to_text() to deal with types not handled by the RdataType enum;
specifically, the NSAP-PTR type (the enum value has a different name,
because of the hyphen) and user-registered types.

This was fine when internal code called these methods, but most callers
of from_text() were converted to dns.rdatatype.RdataType.make(), which
supports both integer and text input, and it doesn't handle the special
cases.

This change adds more hooks into the enum wrapper and moves the special
case handling for RdataType into them.
dns/enum.py
dns/rdatatype.py
tests/test_rdata.py