From 71481b1c341ef31669db4b01df37125528360ebb Mon Sep 17 00:00:00 2001 From: Stephen Martin Date: Fri, 26 Aug 2016 10:29:45 +0100 Subject: [PATCH 1/2] Fixed self.listed[self.dnslist]['TEXT'] = "\n".join(text_record[0].strings) TypeError: sequence item 0: expected str instance, bytes found --- rblwatch/rblwatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rblwatch/rblwatch.py b/rblwatch/rblwatch.py index 0324a32..380be9f 100644 --- a/rblwatch/rblwatch.py +++ b/rblwatch/rblwatch.py @@ -105,7 +105,7 @@ def run(self): self.listed[self.dnslist]['HOST'] = host_record[0].address text_record = self.resolver.query(self.host, "TXT") if len(text_record) > 0: - self.listed[self.dnslist]['TEXT'] = "\n".join(text_record[0].strings) + self.listed[self.dnslist]['TEXT'] = text_record[0].to_text() self.listed[self.dnslist]['ERROR'] = False except NXDOMAIN: self.listed[self.dnslist]['ERROR'] = True @@ -166,7 +166,7 @@ def print_results(self): print(" + Host information: %s" % \ (listed[key]['HOST'])) if 'TEXT' in listed[key].keys(): - print(" + Additional information: %s" % \ + print(" + Additional information:\n %s" % \ (listed[key]['TEXT'])) else: #print "*** Error contacting %s ***" % key From 29e73a4773656c162e8fabc49611d1ad76c48fdc Mon Sep 17 00:00:00 2001 From: Stephen Martin Date: Fri, 26 Aug 2016 10:29:45 +0100 Subject: [PATCH 2/2] Fixed TypeError: sequence item 0: expected str instance, bytes found self.listed[self.dnslist]['TEXT'] = "\n".join(text_record[0].strings) TypeError: sequence item 0: expected str instance, bytes found --- rblwatch/rblwatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rblwatch/rblwatch.py b/rblwatch/rblwatch.py index 0324a32..380be9f 100644 --- a/rblwatch/rblwatch.py +++ b/rblwatch/rblwatch.py @@ -105,7 +105,7 @@ def run(self): self.listed[self.dnslist]['HOST'] = host_record[0].address text_record = self.resolver.query(self.host, "TXT") if len(text_record) > 0: - self.listed[self.dnslist]['TEXT'] = "\n".join(text_record[0].strings) + self.listed[self.dnslist]['TEXT'] = text_record[0].to_text() self.listed[self.dnslist]['ERROR'] = False except NXDOMAIN: self.listed[self.dnslist]['ERROR'] = True @@ -166,7 +166,7 @@ def print_results(self): print(" + Host information: %s" % \ (listed[key]['HOST'])) if 'TEXT' in listed[key].keys(): - print(" + Additional information: %s" % \ + print(" + Additional information:\n %s" % \ (listed[key]['TEXT'])) else: #print "*** Error contacting %s ***" % key