From d1d1f383df9f3f0cf0b19a0f039e85be508fc9d1 Mon Sep 17 00:00:00 2001 From: paulc <212168+paulc@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:57:27 +0100 Subject: [PATCH] Issue #43 (0.9.21 Raises TypeError instead of DNSError when failing to parse HTTPS records) --- README | 3 +++ dnslib/__init__.py | 5 ++++- dnslib/dns.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README b/README index 4b66ec8..b78f221 100644 --- a/README +++ b/README @@ -378,6 +378,9 @@ Changelog: (Issue #32 - thanks to @sbv-csis) Add --strip-aaaa option to dnslib.proxy * 0.9.21 2022-09-19 Minor clean-up / add wheels to distro + * 0.9.22 2022-09027 Issue #43 (0.9.21 Raises TypeError instead of DNSError when failing to parse HTTPS records) + Note that we just fix the exception - there still seems to be a problem with parsing HTTPS records + (Thnaks to @robinlandstrom) License: -------- diff --git a/dnslib/__init__.py b/dnslib/__init__.py index d25f7b1..7493609 100644 --- a/dnslib/__init__.py +++ b/dnslib/__init__.py @@ -380,6 +380,9 @@ (Issue #32 - thanks to @sbv-csis) Add --strip-aaaa option to dnslib.proxy * 0.9.21 2022-09-19 Minor clean-up / add wheels to distro + * 0.9.22 2022-09027 Issue #43 (0.9.21 Raises TypeError instead of DNSError when failing to parse HTTPS records) + Note that we just fix the exception - there still seems to be a problem with parsing HTTPS records + (Thnaks to @robinlandstrom) License: -------- @@ -402,7 +405,7 @@ from dnslib.dns import * -version = "0.9.21" +version = "0.9.22" if __name__ == '__main__': import doctest,sys,textwrap diff --git a/dnslib/dns.py b/dnslib/dns.py index 00a0a54..2e5e951 100644 --- a/dnslib/dns.py +++ b/dnslib/dns.py @@ -1838,7 +1838,7 @@ def parse(cls,buffer,length): params.append((k, v)) return cls(priority, target, params) except (BufferError,BimapError) as e: - raise DNSError("Error unpacking HTTPS: " + str(e) + binascii.hexlify(buffer.data[buffer.offset:])) + raise DNSError("Error unpacking HTTPS: " + str(e) + str(binascii.hexlify(buffer.data[buffer.offset:]))) def pack(self,buffer): buffer.pack("!H", self.priority)