From: Bob Halley Date: Thu, 21 Feb 2019 14:33:00 +0000 (-0800) Subject: $GENERATE was not padding correctly given a pattern like ${0,3} it was X-Git-Tag: v2.0.0rc1~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=268cacfd245ccd1cc59785fb84b329aab00f3ed2;p=thirdparty%2Fdnspython.git $GENERATE was not padding correctly given a pattern like ${0,3} it was using the index field (0) as the padding width, instead of the correct value 3. --- diff --git a/dns/zone.py b/dns/zone.py index 5310a358..21731a6a 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -750,7 +750,6 @@ class _MasterReader(object): mod, sign, offset, width = g3.groups() if sign == '': sign = '+' - width = g3.groups()[2] base = 'd' if not (g1 or g2 or g3): diff --git a/tests/test_generate.py b/tests/test_generate.py index d7e5dbe0..ebd73027 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -527,11 +527,11 @@ class GenerateTestCase(unittest.TestCase): dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.MX, '0 blaz.foo')), - (dns.name.from_text('prefix-27', None), 3600, + (dns.name.from_text('prefix-027', None), 3600, dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.A, '10.0.0.27')), - (dns.name.from_text('prefix-28', None), 3600, + (dns.name.from_text('prefix-028', None), 3600, dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.A, '10.0.0.28')),