| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Classes inherit from object by default; there's no need to explicitly
include this.
Replace super(Foo, self) with super().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
__getstate__ implementation based on tuple and ordered __slots__
is slightly faster than implementation based on dicts.
It also produces smaller blobs.
Speed of this implementation is +- few percents the same
as it was in dnspython 1.16.0 and it now produces smaller blobs.
Fixes: #485
|
| |
|
|
|
|
|
| |
These methods (which convert a str/int into an enum/int) shouldn't be
commonly used by external code, so don't need to exist at the module
level. The make() method on the enum class (renamed from to_enum()) can
still be used, and the internal callers have been updated to use it.
|
| |
|
|
|
|
| |
Add more checking to dns.rdata.register_type, to ensure that an existing
type mnemonic isn't overwritten. Use the enum functionality for mapping
names to values and values to names, rather than duplicating it.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Rdata.to_wire() writes to the file, and doesn't return anything.
|
| | |
|
| |
|
|
|
|
| |
Now that Rdata instances are immutable, there needs to be a way to make
a new Rdata based on an existing one. replace() creates a clone of the
current Rdata, overriding fields with the specified parameters.
|
| |
|
|
|
|
|
| |
When we find a class-independent type, cache it for both class ANY and
the requested type, to avoid an extra dict lookup the next time. If we
don't find anything, cache GenericRdata, to avoid extra module loads the
next time.
|
| |
|
|
|
|
|
| |
This replaces the module cache with a class cache, so that the getattr()
call to retrieve the class happens only when a new type module is
loaded, not in the common case. This also allows avoiding the calls to
dns.rdataclass.to_text() and dns.rdatatype.to_text() in the common case.
|
| |
|
|
| |
Replace the open-coded import_module() with the one in importlib.
|
| | |
|
| | |
|
| |\
| |
| | |
Immutable rdata
|
| | | |
|
| |/
|
|
|
|
| |
This method changes rdata in place, so prevents rdata from becoming
immutable. There are no in-tree users, and if there are out of tree
users, they are rate and hard to find.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling from_text, the zone code needs to apply the current origin
(which may or may not be the zone origin, if sub-zone $ORIGIN statements
are present), and may also want to relativize the contents to the zone
origin.
Previously, this was done by explicitly reading records as absolute, and
then relativizing them laster. With this change, the work is moved to
the tokenizer.
This gets rid of the remaining internal uses of
dns.rdata.choose_relativity(), which prevents rdata from being
immutable.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
| |
a literal string '\#' in python 3.6 causes a DeprecationWarning "invalid escape sequence" as there is no defined backslash escape that looks like that. This change changes the string to a raw string, which makes the intent clear. The text format for unknown RR types is defined in RFC3597 Section 5, and should indeed be the two ascii characters backslash (0x5c) followed by pound sign (0x23).
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
[issue #168]
|
| | |
|
| |
|
|
| |
Signed-off-by: Arthur Gautier <baloo@gandi.net>
|
| |
|
|
| |
also added unit tests for both issues.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
dns.exception.FormErr
|
| | |
|
| |
|
|
| |
NSEC and RRSIG records
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|