diff --git a/bin/tests/system/checkds/tests-checkds.py b/bin/tests/system/checkds/tests-checkds.py index 1c60c93309..2561a17024 100755 --- a/bin/tests/system/checkds/tests-checkds.py +++ b/bin/tests/system/checkds/tests-checkds.py @@ -67,7 +67,7 @@ def verify_zone(zone, transfer): assert verify is not None filename = "{}out".format(zone) - with open(filename, 'w') as file: + with open(filename, 'w', encoding='utf-8') as file: for rr in transfer.answer: file.write(rr.to_text()) file.write('\n') @@ -117,7 +117,7 @@ def read_statefile(server, zone): print("read state file {}".format(filename)) try: - with open(filename, 'r') as file: + with open(filename, 'r', encoding='utf-8') as file: for line in file: if line.startswith(';'): continue @@ -203,7 +203,7 @@ def wait_for_log(filename, log): print("read log file {}".format(filename)) try: - with open(filename, 'r') as file: + with open(filename, 'r', encoding='utf-8') as file: s = mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_READ) if s.find(bytes(log, "ascii")) != -1: found = True diff --git a/bin/tests/system/digdelv/yamlget.py b/bin/tests/system/digdelv/yamlget.py index 60b14cb2d4..9d702036e5 100644 --- a/bin/tests/system/digdelv/yamlget.py +++ b/bin/tests/system/digdelv/yamlget.py @@ -19,7 +19,7 @@ except: print("No python yaml module, skipping") sys.exit(1) -with open(sys.argv[1], "r") as f: +with open(sys.argv[1], "r", encoding="utf-8") as f: for item in yaml.safe_load_all(f): for key in sys.argv[2:]: try: diff --git a/bin/tests/system/doth/stress_http_quota.py b/bin/tests/system/doth/stress_http_quota.py index 1e56538aa9..e2ddae1819 100755 --- a/bin/tests/system/doth/stress_http_quota.py +++ b/bin/tests/system/doth/stress_http_quota.py @@ -128,7 +128,7 @@ class SubDIG: def run(self): # pylint: disable=consider-using-with - with open(os.devnull, 'w') as devnull: + with open(os.devnull, 'w', encoding='utf-8') as devnull: self.sub_process = subprocess.Popen(self.get_command(), shell=True, stdout=devnull) diff --git a/bin/tests/system/rpzextra/tests-rpz-passthru-logging.py b/bin/tests/system/rpzextra/tests-rpz-passthru-logging.py index c4afa43ae9..efc0ac053b 100755 --- a/bin/tests/system/rpzextra/tests-rpz-passthru-logging.py +++ b/bin/tests/system/rpzextra/tests-rpz-passthru-logging.py @@ -37,11 +37,11 @@ def test_rpz_passthru_logging(named_port): assert os.path.isfile(rpz_passthru_logfile) assert os.path.isfile(rpz_logfile) - with open(rpz_passthru_logfile) as log_file: + with open(rpz_passthru_logfile, encoding='utf-8') as log_file: line = log_file.read() assert "rpz QNAME PASSTHRU rewrite allowed/A/IN" in line - with open(rpz_logfile) as log_file: + with open(rpz_logfile, encoding='utf-8') as log_file: line = log_file.read() assert "rpz QNAME PASSTHRU rewrite allowed/A/IN" not in line assert "rpz QNAME NXDOMAIN rewrite baddomain/A/IN" in line diff --git a/bin/tests/system/statschannel/helper.py b/bin/tests/system/statschannel/helper.py index c43bea93b8..fb9a2eb12b 100644 --- a/bin/tests/system/statschannel/helper.py +++ b/bin/tests/system/statschannel/helper.py @@ -78,13 +78,6 @@ def zone_mtime(zonedir, name): return mtime -def zone_keyid(nameserver, zone, key): - with open('{}/{}.{}.id'.format(nameserver, zone, key)) as f: - keyid = f.read().strip() - print('{}-{} ID: {}'.format(zone, key, keyid)) - return keyid - - def create_msg(qname, qtype): msg = dns.message.make_query(qname, qtype, want_dnssec=True, use_edns=0, payload=4096) diff --git a/doc/arm/conf.py b/doc/arm/conf.py index 1458fe9f47..b8aca9b33c 100644 --- a/doc/arm/conf.py +++ b/doc/arm/conf.py @@ -87,10 +87,10 @@ def setup(_): # -- Project information ----------------------------------------------------- -project = u'BIND 9' +project = 'BIND 9' # pylint: disable=redefined-builtin -copyright = u'2021, Internet Systems Consortium' -author = u'Internet Systems Consortium' +copyright = '2021, Internet Systems Consortium' +author = 'Internet Systems Consortium' # -- General configuration --------------------------------------------------- @@ -140,7 +140,7 @@ latex_engine = 'xelatex' # pylint disable=line-too-long latex_documents = [ - (master_doc, 'Bv9ARM.tex', u'BIND 9 Administrator Reference Manual', author, 'manual'), + (master_doc, 'Bv9ARM.tex', 'BIND 9 Administrator Reference Manual', author, 'manual'), ] latex_logo = "isc-logo.pdf" diff --git a/doc/man/conf.py b/doc/man/conf.py index 8b4e37c777..6395cf0974 100644 --- a/doc/man/conf.py +++ b/doc/man/conf.py @@ -30,13 +30,13 @@ # -- Project information ----------------------------------------------------- -project = u'BIND 9' +project = 'BIND 9' # pylint: disable=wrong-import-position import datetime year = datetime.datetime.now().year # pylint: disable=redefined-builtin -copyright = u"%d, Internet Systems Consortium" % year -author = u'Internet Systems Consortium' +copyright = "%d, Internet Systems Consortium" % year +author = 'Internet Systems Consortium' # -- General configuration ---------------------------------------------------