]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
explicitly convert byte to string
authorMark Andrews <marka@isc.org>
Mon, 18 Feb 2019 05:36:59 +0000 (16:36 +1100)
committerEvan Hunt <each@isc.org>
Thu, 7 Mar 2019 04:41:09 +0000 (20:41 -0800)
(cherry picked from commit ec3d830bc50e43858c7982df9b9db95aa8cffca0)

bin/python/isc/checkds.py.in
bin/python/isc/keyzone.py.in

index cac226ee4dca2a8fc4834a1fd98211507216a75a..b5cbe3fd05f31e8eeb9afbcfda211fa925e9c4b1 100644 (file)
@@ -107,6 +107,8 @@ def check(zone, args):
         fp, _ = Popen(cmd, stdout=PIPE).communicate()
 
     for line in fp.splitlines():
+        if type(line) is not str:
+            line = line.decode('ascii')
         rrlist.append(SECRR(line, args.lookaside))
     rrlist = sorted(rrlist, key=lambda rr: (rr.keyid, rr.keyalg, rr.hashalg))
 
@@ -128,6 +130,8 @@ def check(zone, args):
         fp, _ = Popen(cmd, stdin=PIPE, stdout=PIPE).communicate(intods)
 
     for line in fp.splitlines():
+        if type(line) is not str:
+            line = line.decode('ascii')
         klist.append(SECRR(line, args.lookaside))
 
     if len(klist) < 1:
index 2451d439e4b867fa61b2a537af7a0ff5b94beb6d..bc8c51d72fbcff4b905ccc7fd18d6bf659bc50b5 100644 (file)
@@ -43,6 +43,8 @@ class keyzone:
         fp, _ = Popen([czpath, "-o", "-", name, filename],
                       stdout=PIPE, stderr=PIPE).communicate()
         for line in fp.splitlines():
+            if type(line) is not str:
+                line = line.decode('ascii')
             if re.search('^[:space:]*;', line):
                 continue
             fields = line.split()