]> granicus.if.org Git - pdns/commitdiff
dnsdist: Fix a UnicodeDecodeError with py2 in the regression tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 22 Jul 2019 13:13:33 +0000 (15:13 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 22 Jul 2019 13:13:33 +0000 (15:13 +0200)
regression-tests.dnsdist/test_BrokenAnswer.py

index a706dfa7e42d9bb78a0cf0c82495f6f843ddb5b5..78bd713358beaa837625c1b54cbf667850e62378 100644 (file)
@@ -25,7 +25,7 @@ def responseCallback(request):
     raw = response.to_wire()
     # first label length of this rrset is at 12 (dnsheader) + length(qname) + 2 (leading label length + trailing 0) + 2 (qtype) + 2 (qclass)
     offset = 12 + len(str(request.question[0].name)) + 2 + 2 + 2
-    altered = raw[:offset] + chr(255).encode() + raw[offset+1:]
+    altered = raw[:offset] + b'\xff' + raw[offset+1:]
     return altered
 
 class TestBrokenAnswerECS(DNSDistTest):