r47183 - some cleanups, bytes-ising
hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Fri, 8 Apr 2016 01:41:21 -0600 (MDT)
| Newsgroups | gmane.comp.python.twisted.commits |
|---|---|
| Message-ID | <[email protected]> |
Author: hawkowl
Date: Fri Apr 8 01:41:05 2016
New Revision: 47183
Modified:
branches/t-names-authority-py3-8259/twisted/names/authority.py
branches/t-names-authority-py3-8259/twisted/names/dns.py
branches/t-names-authority-py3-8259/twisted/names/secondary.py
branches/t-names-authority-py3-8259/twisted/names/test/test_examples.py
branches/t-names-authority-py3-8259/twisted/names/test/test_names.py
Log:
some cleanups, bytes-ising
Modified: branches/t-names-authority-py3-8259/twisted/names/authority.py
==============================================================================
--- branches/t-names-authority-py3-8259/twisted/names/authority.py (original)
+++ branches/t-names-authority-py3-8259/twisted/names/authority.py Fri Apr 8 01:41:05 2016
@@ -5,7 +5,8 @@
"""
Authoritative resolvers.
"""
-from __future__ import absolute_import
+
+from __future__ import absolute_import, division
import os
import time
Modified: branches/t-names-authority-py3-8259/twisted/names/dns.py
==============================================================================
--- branches/t-names-authority-py3-8259/twisted/names/dns.py (original)
+++ branches/t-names-authority-py3-8259/twisted/names/dns.py Fri Apr 8 01:41:05 2016
@@ -40,21 +40,20 @@
'PORT',
'AuthoritativeDomainError', 'DNSQueryTimeoutError', 'DomainError',
- ]
+]
-# System imports
-import inspect, struct, random, socket
-from itertools import chain
+import inspect
+import struct
+import random
+import socket
+from itertools import chain
from io import BytesIO
-
-AF_INET6 = socket.AF_INET6
-
from zope.interface import implementer, Interface, Attribute
+AF_INET6 = socket.AF_INET6
-# Twisted imports
from twisted.internet import protocol, defer
from twisted.internet.error import CannotListenError
from twisted.python import log, failure
@@ -70,6 +69,7 @@
ordinal value.
@type ordinal: C{int}
+
@rtype: C{bytes}
"""
return bytes([ordinal])
@@ -77,10 +77,11 @@
def _nicebytes(bytes):
"""
- Represent a mostly textful bytes object in a way suitable for presentation
- to an end user.
+ Represent a mostly textful bytes object in a way suitable for
+ presentation to an end user.
@param bytes: The bytes to represent.
+
@rtype: C{str}
"""
return repr(bytes)[1:]
@@ -212,7 +213,7 @@
"""
Split a domain name into its constituent labels.
- @type name: C{str}
+ @type name: C{bytes}
@param name: A fully qualified domain name (with or without a
trailing dot).
@@ -261,24 +262,29 @@
def str2time(s):
"""
- Parse a string description of an interval into an integer number of seconds.
+ Parse a string description of an interval into an integer number of
+ seconds.
@param s: An interval definition constructed as an interval duration
- followed by an interval unit. An interval duration is a base ten
- representation of an integer. An interval unit is one of the following
+ followed by an interval unit. An interval duration is a base ten
+ representation of an integer. An interval unit is one of the following
letters: S (seconds), M (minutes), H (hours), D (days), W (weeks), or Y
- (years). For example: C{"3S"} indicates an interval of three seconds;
- C{"5D"} indicates an interval of five days. Alternatively, C{s} may be
+ (years). For example: C{"3S"} indicates an interval of three seconds;
+ C{"5D"} indicates an interval of five days. Alternatively, C{s} may be
any non-string and it will be returned unmodified.
- @type s: text string (C{str}) for parsing; anything else for passthrough.
+ @type s: text string (L{bytes} or L{unicode}) for parsing; anything else
+ for passthrough.
- @return: an C{int} giving the interval represented by the string C{s}, or
+ @return: an L{int} giving the interval represented by the string C{s}, or
whatever C{s} is if it is not a string.
"""
suffixes = (
('S', 1), ('M', 60), ('H', 60 * 60), ('D', 60 * 60 * 24),
('W', 60 * 60 * 24 * 7), ('Y', 60 * 60 * 24 * 365)
)
+ if _PY3 and isinstance(s, bytes):
+ s = s.decode('ascii')
+
if isinstance(s, str):
s = s.upper().strip()
for (suff, mult) in suffixes:
@@ -408,6 +414,10 @@
@type name: C{bytes}
"""
def __init__(self, name=b''):
+ """
+ @param name: A name.
+ @type name: L{unicode} or L{bytes}
+ """
if isinstance(name, unicode):
name = name.encode('idna')
if not isinstance(name, bytes):
@@ -520,8 +530,13 @@
Represent a single DNS query.
@ivar name: The name about which this query is requesting information.
+ @type name: L{Name}
+
@ivar type: The query type.
+ @type type: L{int}
+
@ivar cls: The query class.
+ @type cls: L{int}
"""
name = None
type = None
@@ -529,8 +544,8 @@
def __init__(self, name=b'', type=A, cls=IN):
"""
- @type name: C{bytes}
- @param name: The name about which to request information.
+ @type name: L{bytes} or L{unicode}
+ @param name: See L{Query.name}
@type type: C{int}
@param type: The query type.
@@ -826,13 +841,20 @@
@cvar fmt: C{str} specifying the byte format of an RR.
@ivar name: The name about which this reply contains information.
+ @type name: L{Name}
+
@ivar type: The query type of the original request.
+ @type type: L{int}
+
@ivar cls: The query class of the original request.
+
@ivar ttl: The time-to-live for this record.
- @ivar payload: An object that implements the IEncodable interface
+ @type ttl: L{int}
+
+ @ivar payload: An object that implements the L{IEncodable} interface
- @ivar auth: A C{bool} indicating whether this C{RRHeader} was parsed from an
- authoritative message.
+ @ivar auth: A C{bool} indicating whether this C{RRHeader} was parsed from
+ an authoritative message.
"""
compareAttributes = ('name', 'type', 'cls', 'ttl', 'payload', 'auth')
@@ -847,10 +869,11 @@
cachedResponse = None
- def __init__(self, name=b'', type=A, cls=IN, ttl=0, payload=None, auth=False):
+ def __init__(self, name=b'', type=A, cls=IN, ttl=0, payload=None,
+ auth=False):
"""
- @type name: C{bytes}
- @param name: The name about which this reply contains information.
+ @type name: C{bytes} or L{unicode}
+ @param name: See L{RRHeader.name}
@type type: C{int}
@param type: The query type.
@@ -932,6 +955,10 @@
name = None
def __init__(self, name=b'', ttl=None):
+ """
+ @param name: See L{SimpleRecord.name}
+ @type name: L{bytes} or L{unicode}
+ """
self.name = Name(name)
self.ttl = str2time(ttl)
@@ -1057,7 +1084,7 @@
"""
An IPv4 host address.
- @type address: C{str}
+ @type address: C{bytes}
@ivar address: The packed network-order representation of the IPv4 address
associated with this record.
@@ -1071,6 +1098,14 @@
address = None
def __init__(self, address='0.0.0.0', ttl=None):
+ """
+ @type address: L{bytes} or L{unicode}
+ @param address: The IPv4 address associated with this record, in
+ quad-dotted notation.
+ """
+ if _PY3 and isinstance(address, bytes):
+ address = address.decode('idna')
+
address = socket.inet_aton(address)
self.address = address
self.ttl = str2time(ttl)
@@ -1139,13 +1174,22 @@
@ivar ttl: The default TTL to use for records served from this zone.
"""
fancybasename = 'SOA'
- compareAttributes = ('serial', 'mname', 'rname', 'refresh', 'expire', 'retry', 'minimum', 'ttl')
- showAttributes = (('mname', 'mname', '%s'), ('rname', 'rname', '%s'), 'serial', 'refresh', 'retry', 'expire', 'minimum', 'ttl')
+ compareAttributes = ('serial', 'mname', 'rname', 'refresh', 'expire',
+ 'retry', 'minimum', 'ttl')
+ showAttributes = (('mname', 'mname', '%s'), ('rname', 'rname', '%s'),
+ 'serial', 'refresh', 'retry', 'expire', 'minimum', 'ttl')
TYPE = SOA
def __init__(self, mname=b'', rname=b'', serial=0, refresh=0, retry=0,
expire=0, minimum=0, ttl=None):
+ """
+ @param mname: See L{Record_SOA.mname}
+ @type mname: L{bytes} or L{unicode}
+
+ @param rname: See L{Record_SOA.rname}
+ @type rname: L{bytes} or L{unicode}
+ """
self.mname, self.rname = Name(mname), Name(rname)
self.serial, self.refresh = str2time(serial), str2time(refresh)
self.minimum, self.expire = str2time(minimum), str2time(expire)
@@ -1223,7 +1267,7 @@
This record type is obsolete. See L{Record_SRV}.
- @type address: C{str}
+ @type address: C{bytes}
@ivar address: The packed network-order representation of the IPv4 address
associated with this record.
@@ -1231,7 +1275,7 @@
@ivar protocol: The 8 bit IP protocol number for which this service map is
relevant.
- @type map: C{bytestring}
+ @type map: L{bytes}
@ivar map: A bitvector indicating the services available at the specified
address.
@@ -1247,7 +1291,15 @@
_address = property(lambda self: socket.inet_ntoa(self.address))
- def __init__(self, address='0.0.0.0', protocol=0, map='', ttl=None):
+ def __init__(self, address='0.0.0.0', protocol=0, map=b'', ttl=None):
+ """
+ @type address: L{bytes} or L{unicode}
+ @param address: The IPv4 address associated with this record, in
+ quad-dotted notation.
+ """
+ if _PY3 and isinstance(address, bytes):
+ address = address.decode('idna')
+
self.address = socket.inet_aton(address)
self.protocol, self.map = protocol, map
self.ttl = str2time(ttl)
@@ -1275,7 +1327,7 @@
"""
An IPv6 host address.
- @type address: C{str}
+ @type address: L{bytes}
@ivar address: The packed network-order representation of the IPv6 address
associated with this record.
@@ -1294,6 +1346,13 @@
_address = property(lambda self: socket.inet_ntop(AF_INET6, self.address))
def __init__(self, address='::', ttl=None):
+ """
+ @type address: L{bytes} or L{unicode}
+ @param address: The IPv6 address for this host, in RFC 2373 format.
+ """
+ if _PY3 and isinstance(address, bytes):
+ address = address.decode('idna')
+
self.address = socket.inet_pton(AF_INET6, address)
self.ttl = str2time(ttl)
@@ -1321,7 +1380,7 @@
@type prefixLen: C{int}
@ivar prefixLen: The length of the suffix.
- @type suffix: C{str}
+ @type suffix: C{bytes}
@ivar suffix: An IPv6 address suffix in network order.
@type prefix: L{Name}
@@ -1348,6 +1407,16 @@
_suffix = property(lambda self: socket.inet_ntop(AF_INET6, self.suffix))
def __init__(self, prefixLen=0, suffix='::', prefix=b'', ttl=None):
+ """
+ @param suffix: An IPv6 address suffix in in RFC 2373 format.
+ @type suffix: L{bytes} or L{unicode}
+
+ @param prefix: An IPv6 address prefix for other A6 records.
+ @type prefix: L{bytes} or L{unicode}
+ """
+ if _PY3 and isinstance(suffix, bytes):
+ suffix = suffix.decode('idna')
+
self.prefixLen = prefixLen
self.suffix = socket.inet_pton(AF_INET6, suffix)
self.prefix = Name(prefix)
@@ -1437,6 +1506,10 @@
showAttributes = ('priority', 'weight', ('target', 'target', '%s'), 'port', 'ttl')
def __init__(self, priority=0, weight=0, port=0, target=b'', ttl=None):
+ """
+ @param target: See L{Record_SRV.target}
+ @type target: L{bytes} or L{unicode}
+ """
self.priority = int(priority)
self.weight = int(weight)
self.port = int(port)
@@ -1517,8 +1590,12 @@
('service', 'service', '%s'), ('regexp', 'regexp', '%s'),
('replacement', 'replacement', '%s'), 'ttl')
- def __init__(self, order=0, preference=0, flags=b'', service=b'', regexp=b'',
- replacement=b'', ttl=None):
+ def __init__(self, order=0, preference=0, flags=b'', service=b'',
+ regexp=b'', replacement=b'', ttl=None):
+ """
+ @param replacement: See L{Record_NAPTR.replacement}
+ @type replacement: L{bytes} or L{unicode}
+ """
self.order = int(order)
self.preference = int(preference)
self.flags = Charstr(flags)
@@ -1585,6 +1662,10 @@
showAttributes = ('subtype', ('hostname', 'hostname', '%s'), 'ttl')
def __init__(self, subtype=0, hostname=b'', ttl=None):
+ """
+ @param hostname: See L{Record_AFSDB.hostname}
+ @type hostname: L{bytes} or L{unicode}
+ """
self.subtype = int(subtype)
self.hostname = Name(hostname)
self.ttl = str2time(ttl)
@@ -1632,6 +1713,13 @@
showAttributes = (('mbox', 'mbox', '%s'), ('txt', 'txt', '%s'), 'ttl')
def __init__(self, mbox=b'', txt=b'', ttl=None):
+ """
+ @param mbox: See L{Record_RP.mbox}.
+ @type mbox: L{bytes} or L{unicode}
+
+ @param txt: See L{Record_RP.txt}
+ @type txt: L{bytes} or L{unicode}
+ """
self.mbox = Name(mbox)
self.txt = Name(txt)
self.ttl = str2time(ttl)
@@ -1659,10 +1747,10 @@
"""
Host information.
- @type cpu: C{bytestring}
+ @type cpu: L{bytes}
@ivar cpu: Specifies the CPU type.
- @type os: C{bytestring}
+ @type os: L{bytes}
@ivar os: Specifies the OS.
@type ttl: C{int}
@@ -1675,7 +1763,7 @@
showAttributes = (('cpu', _nicebytes), ('os', _nicebytes), 'ttl')
compareAttributes = ('cpu', 'os', 'ttl')
- def __init__(self, cpu='', os='', ttl=None):
+ def __init__(self, cpu=b'', os=b'', ttl=None):
self.cpu, self.os = cpu, os
self.ttl = str2time(ttl)
@@ -1739,6 +1827,13 @@
'ttl')
def __init__(self, rmailbx=b'', emailbx=b'', ttl=None):
+ """
+ @param rmailbx: See L{Record_MINFO.rmailbx}.
+ @type rmailbx: L{bytes} or L{unicode}
+
+ @param emailbx: See L{Record_MINFO.rmailbx}.
+ @type emailbx: L{bytes} or L{unicode}
+ """
self.rmailbx, self.emailbx = Name(rmailbx), Name(emailbx)
self.ttl = str2time(ttl)
@@ -1783,7 +1878,12 @@
showAttributes = ('preference', ('name', 'name', '%s'), 'ttl')
def __init__(self, preference=0, name=b'', ttl=None, **kwargs):
- self.preference, self.name = int(preference), Name(kwargs.get('exchange', name))
+ """
+ @param name: See L{Record_MX.name}.
+ @type name: L{bytes} or L{unicode}
+ """
+ self.preference = int(preference)
+ self.name = Name(kwargs.get('exchange', name))
self.ttl = str2time(ttl)
def encode(self, strio, compDict = None):
@@ -1810,7 +1910,8 @@
@ivar data: Freeform text which makes up this record.
@type ttl: C{int}
- @ivar ttl: The maximum number of seconds which this record should be cached.
+ @ivar ttl: The maximum number of seconds which this record should be
+ cached.
"""
TYPE = TXT
@@ -1900,7 +2001,7 @@
Structurally, freeform text. Semantically, a policy definition, formatted
as defined in U{rfc 4408<http://www.faqs.org/rfcs/rfc4408.html>}.
- @type data: C{list} of C{str}
+ @type data: C{list} of C{bytes}
@ivar data: Freeform text which makes up this record.
@type ttl: C{int}
@@ -2283,8 +2384,8 @@
def toStr(self):
"""
- Encode this L{Message} into a byte string in the format described by RFC
- 1035.
+ Encode this L{Message} into a byte string in the format described by
+ RFC 1035.
@rtype: C{bytes}
"""
@@ -2315,7 +2416,8 @@
Most importantly, L{_EDNSMessage.fromStr} will interpret and remove I{OPT}
records that are present in the additional records section.
- The I{OPT} records are used to populate certain I{EDNS} specific attributes.
+ The I{OPT} records are used to populate certain I{EDNS} specific
+ attributes.
L{_EDNSMessage.toStr} will add suitable I{OPT} records to the additional
section to represent the extended EDNS information.
@@ -2323,22 +2425,37 @@
@see: U{https://tools.ietf.org/html/rfc6891}
@ivar id: See L{__init__}
+
@ivar answer: See L{__init__}
+
@ivar opCode: See L{__init__}
+
@ivar auth: See L{__init__}
+
@ivar trunc: See L{__init__}
+
@ivar recDes: See L{__init__}
+
@ivar recAv: See L{__init__}
+
@ivar rCode: See L{__init__}
+
@ivar ednsVersion: See L{__init__}
+
@ivar dnssecOK: See L{__init__}
+
@ivar authenticData: See L{__init__}
+
@ivar checkingDisabled: See L{__init__}
+
@ivar maxSize: See L{__init__}
@ivar queries: See L{__init__}
+
@ivar answers: See L{__init__}
+
@ivar authority: See L{__init__}
+
@ivar additional: See L{__init__}
@ivar _messageFactory: A constructor of L{Message} instances. Called by
@@ -2494,8 +2611,8 @@
Convert to a standard L{dns.Message}.
If C{ednsVersion} is not None, an L{_OPTHeader} instance containing all
- the I{EDNS} specific attributes and options will be appended to the list
- of C{additional} records.
+ the I{EDNS} specific attributes and options will be appended to the
+ list of C{additional} records.
@return: A L{dns.Message}
@rtype: L{dns.Message}
@@ -2550,8 +2667,8 @@
specific attributes C{extendedRCODE}, c{ednsVersion}, c{dnssecOK},
c{ednsOptions}.
- The C{extendedRCODE} will be combined with C{message.rCode} and assigned
- to C{self.rCode}.
+ The C{extendedRCODE} will be combined with C{message.rCode} and
+ assigned to C{self.rCode}.
@param message: The source L{Message}.
@type message: L{Message}
@@ -2578,8 +2695,8 @@
rCode=message.rCode,
authenticData=message.authenticData,
checkingDisabled=message.checkingDisabled,
- # Default to None, it will be updated later when the OPT records are
- # parsed.
+ # Default to None, it will be updated later when the OPT records
+ # are parsed.
ednsVersion=None,
dnssecOK=False,
queries=message.queries[:],
Modified: branches/t-names-authority-py3-8259/twisted/names/secondary.py
==============================================================================
--- branches/t-names-authority-py3-8259/twisted/names/secondary.py (original)
+++ branches/t-names-authority-py3-8259/twisted/names/secondary.py Fri Apr 8 01:41:05 2016
@@ -1,7 +1,8 @@
# -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
-from __future__ import absolute_import
+
+from __future__ import absolute_import, division
__all__ = ['SecondaryAuthority', 'SecondaryAuthorityService']
Modified: branches/t-names-authority-py3-8259/twisted/names/test/test_examples.py
==============================================================================
--- branches/t-names-authority-py3-8259/twisted/names/test/test_examples.py (original)
+++ branches/t-names-authority-py3-8259/twisted/names/test/test_examples.py Fri Apr 8 01:41:05 2016
@@ -5,6 +5,8 @@
Tests for L{twisted.names} example scripts.
"""
+from __future__ import absolute_import, division
+
import sys
from twisted.python.filepath import FilePath
Modified: branches/t-names-authority-py3-8259/twisted/names/test/test_names.py
==============================================================================
--- branches/t-names-authority-py3-8259/twisted/names/test/test_names.py (original)
+++ branches/t-names-authority-py3-8259/twisted/names/test/test_names.py Fri Apr 8 01:41:05 2016
@@ -5,11 +5,13 @@
Test cases for twisted.names.
"""
-import socket, operator, copy
+from __future__ import absolute_import, division
-from io import BytesIO
+import socket
+import operator
+import copy
-from twisted.python.compat import NativeStringIO
+from io import BytesIO
from functools import partial, reduce
from struct import pack
@@ -23,6 +25,7 @@
from twisted.names.client import Resolver
from twisted.names.secondary import (
SecondaryAuthorityService, SecondaryAuthority)
+from twisted.python.compat import NativeStringIO
from twisted.test.proto_helpers import StringTransport, MemoryReactorClock
@@ -37,8 +40,8 @@
soa_record = dns.Record_SOA(
- mname = 'test-domain.com',
- rname = 'root.test-domain.com',
+ mname = b'test-domain.com',
+ rname = b'root.test-domain.com',
serial = 100,
refresh = 1234,
minimum = 7654,
@@ -48,8 +51,8 @@
)
reverse_soa = dns.Record_SOA(
- mname = '93.84.28.in-addr.arpa',
- rname = '93.84.28.in-addr.arpa',
+ mname = b'93.84.28.in-addr.arpa',
+ rname = b'93.84.28.in-addr.arpa',
serial = 120,
refresh = 54321,
minimum = 382,
@@ -59,8 +62,8 @@
)
my_soa = dns.Record_SOA(
- mname = 'my-domain.com',
- rname = 'postmaster.test-domain.com',
+ mname = b'my-domain.com',
+ rname = b'postmaster.test-domain.com',
serial = 130,
refresh = 12345,
minimum = 1,
@@ -73,49 +76,49 @@
records = {
b'test-domain.com': [
soa_record,
- dns.Record_A('127.0.0.1'),
- dns.Record_NS('39.28.189.39'),
+ dns.Record_A(b'127.0.0.1'),
+ dns.Record_NS(b'39.28.189.39'),
dns.Record_SPF(b'v=spf1 mx/30 mx:example.org/30 -all'),
dns.Record_SPF(b'v=spf1 +mx a:\0colo', b'.example.com/28 -all not valid'),
- dns.Record_MX(10, 'host.test-domain.com'),
+ dns.Record_MX(10, b'host.test-domain.com'),
dns.Record_HINFO(os=b'Linux', cpu=b'A Fast One, Dontcha know'),
- dns.Record_CNAME('canonical.name.com'),
- dns.Record_MB('mailbox.test-domain.com'),
- dns.Record_MG('mail.group.someplace'),
+ dns.Record_CNAME(b'canonical.name.com'),
+ dns.Record_MB(b'mailbox.test-domain.com'),
+ dns.Record_MG(b'mail.group.someplace'),
dns.Record_TXT(b'A First piece of Text', b'a SecoNd piece'),
- dns.Record_A6(0, 'ABCD::4321', ''),
- dns.Record_A6(12, '0:0069::0', 'some.network.tld'),
- dns.Record_A6(8, '0:5634:1294:AFCB:56AC:48EF:34C3:01FF', 'tra.la.la.net'),
+ dns.Record_A6(0, b'ABCD::4321', b''),
+ dns.Record_A6(12, b'0:0069::0', b'some.network.tld'),
+ dns.Record_A6(8, b'0:5634:1294:AFCB:56AC:48EF:34C3:01FF', 'tra.la.la.net'),
dns.Record_TXT(b'Some more text, haha! Yes. \0 Still here?'),
- dns.Record_MR('mail.redirect.or.whatever'),
- dns.Record_MINFO(rmailbx='r mail box', emailbx='e mail box'),
- dns.Record_AFSDB(subtype=1, hostname='afsdb.test-domain.com'),
- dns.Record_RP(mbox='whatever.i.dunno', txt='some.more.text'),
- dns.Record_WKS('12.54.78.12', socket.IPPROTO_TCP,
+ dns.Record_MR(b'mail.redirect.or.whatever'),
+ dns.Record_MINFO(rmailbx=b'r mail box', emailbx=b'e mail box'),
+ dns.Record_AFSDB(subtype=1, hostname=b'afsdb.test-domain.com'),
+ dns.Record_RP(mbox=b'whatever.i.dunno', txt=b'some.more.text'),
+ dns.Record_WKS(b'12.54.78.12', socket.IPPROTO_TCP,
b'\x12\x01\x16\xfe\xc1\x00\x01'),
dns.Record_NAPTR(100, 10, b"u", b"sip+E2U",
b"!^.*$!sip:[email protected]!"),
- dns.Record_AAAA('AF43:5634:1294:AFCB:56AC:48EF:34C3:01FF')],
+ dns.Record_AAAA(b'AF43:5634:1294:AFCB:56AC:48EF:34C3:01FF')],
b'http.tcp.test-domain.com': [
- dns.Record_SRV(257, 16383, 43690, 'some.other.place.fool')
+ dns.Record_SRV(257, 16383, 43690, b'some.other.place.fool')
],
b'host.test-domain.com': [
- dns.Record_A('123.242.1.5'),
- dns.Record_A('0.255.0.255'),
+ dns.Record_A(b'123.242.1.5'),
+ dns.Record_A(b'0.255.0.255'),
],
b'host-two.test-domain.com': [
#
# Python bug
# dns.Record_A('255.255.255.255'),
#
- dns.Record_A('255.255.255.254'),
- dns.Record_A('0.0.0.0')
+ dns.Record_A(b'255.255.255.254'),
+ dns.Record_A(b'0.0.0.0')
],
b'cname.test-domain.com': [
- dns.Record_CNAME('test-domain.com')
+ dns.Record_CNAME(b'test-domain.com')
],
b'anothertest-domain.com': [
- dns.Record_A('1.2.3.4')],
+ dns.Record_A(b'1.2.3.4')],
}
)
@@ -123,7 +126,7 @@
soa = (b'93.84.28.in-addr.arpa', reverse_soa),
records = {
b'123.93.84.28.in-addr.arpa': [
- dns.Record_PTR('test.host-reverse.lookup.com'),
+ dns.Record_PTR(b'test.host-reverse.lookup.com'),
reverse_soa
]
}
@@ -135,10 +138,10 @@
records = {
b'my-domain.com': [
my_soa,
- dns.Record_A('1.2.3.4', ttl='1S'),
- dns.Record_NS('ns1.domain', ttl='2M'),
- dns.Record_NS('ns2.domain', ttl='3H'),
- dns.Record_SRV(257, 16383, 43690, 'some.other.place.fool', ttl='4D')
+ dns.Record_A(b'1.2.3.4', ttl='1S'),
+ dns.Record_NS(b'ns1.domain', ttl='2M'),
+ dns.Record_NS(b'ns2.domain', ttl='3H'),
+ dns.Record_SRV(257, 16383, 43690, b'some.other.place.fool', ttl='4D')
]
}
)