From e1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Dec 2010 02:31:40 +0100 Subject: dnspython: Merge in new upstream. Autobuild-User: Jelmer Vernooij Autobuild-Date: Mon Dec 20 03:21:52 CET 2010 on sn-devel-104 --- lib/dnspython/dns/message.py | 2 +- lib/dnspython/dns/rdata.py | 4 ++++ lib/dnspython/dns/resolver.py | 8 ++++++++ lib/dnspython/dns/version.py | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/dnspython/dns') diff --git a/lib/dnspython/dns/message.py b/lib/dnspython/dns/message.py index 5ec711e1eb..a124a3e177 100644 --- a/lib/dnspython/dns/message.py +++ b/lib/dnspython/dns/message.py @@ -686,7 +686,7 @@ class _WireReader(object): deleting = None if deleting == dns.rdataclass.ANY or \ (deleting == dns.rdataclass.NONE and \ - section == self.message.answer): + section is self.message.answer): covers = dns.rdatatype.NONE rd = None else: diff --git a/lib/dnspython/dns/rdata.py b/lib/dnspython/dns/rdata.py index ce0268697b..399677e984 100644 --- a/lib/dnspython/dns/rdata.py +++ b/lib/dnspython/dns/rdata.py @@ -28,6 +28,7 @@ chunk of hexstring that _hexify() produces before whitespace occurs. import cStringIO import dns.exception +import dns.name import dns.rdataclass import dns.rdatatype import dns.tokenizer @@ -252,6 +253,9 @@ class Rdata(object): return NotImplemented return self._cmp(other) > 0 + def __hash__(self): + return hash(self.to_digestable(dns.name.root)) + def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True): """Build an rdata object from text format. diff --git a/lib/dnspython/dns/resolver.py b/lib/dnspython/dns/resolver.py index f803eb6d20..30977f3a8b 100644 --- a/lib/dnspython/dns/resolver.py +++ b/lib/dnspython/dns/resolver.py @@ -61,6 +61,10 @@ class NoRootSOA(dns.exception.DNSException): This should never happen!""" pass +class NoMetaqueries(dns.exception.DNSException): + """Metaqueries are not allowed.""" + pass + class Answer(object): """DNS stub resolver answer @@ -571,8 +575,12 @@ class Resolver(object): qname = dns.name.from_text(qname, None) if isinstance(rdtype, (str, unicode)): rdtype = dns.rdatatype.from_text(rdtype) + if dns.rdatatype.is_metatype(rdtype): + raise NoMetaqueries if isinstance(rdclass, (str, unicode)): rdclass = dns.rdataclass.from_text(rdclass) + if dns.rdataclass.is_metaclass(rdclass): + raise NoMetaqueries qnames_to_try = [] if qname.is_absolute(): qnames_to_try.append(qname) diff --git a/lib/dnspython/dns/version.py b/lib/dnspython/dns/version.py index fe0e324217..46799a77d9 100644 --- a/lib/dnspython/dns/version.py +++ b/lib/dnspython/dns/version.py @@ -17,7 +17,7 @@ MAJOR = 1 MINOR = 9 -MICRO = 2 +MICRO = 3 RELEASELEVEL = 0x0f SERIAL = 0 -- cgit