From 7037844329e0bb9a29c2c4e3e8ead717bb9487a7 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 13 Nov 2025 09:20:51 -0500 Subject: [PATCH] Do not mutate default values Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- modules/remotebackend/pdns_unittest.py | 4 +++- regression-tests.dnsdist/dnsdisttests.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/remotebackend/pdns_unittest.py b/modules/remotebackend/pdns_unittest.py index 469c545a48..3021dbd84f 100644 --- a/modules/remotebackend/pdns_unittest.py +++ b/modules/remotebackend/pdns_unittest.py @@ -113,7 +113,9 @@ class Handler(pdns.remotebackend.Handler): domain['meta'][kind] = value self.result = True - def do_adddomainkey(self, name='', key={}, **kwargs): + def do_adddomainkey(self, name='', key=None, **kwargs): + if key is None: + key = {} domain = self.get_domain(name) if domain: k_id = len(domain['keys']) + 1 diff --git a/regression-tests.dnsdist/dnsdisttests.py b/regression-tests.dnsdist/dnsdisttests.py index 36ab4c51ba..24e2c22ed0 100644 --- a/regression-tests.dnsdist/dnsdisttests.py +++ b/regression-tests.dnsdist/dnsdisttests.py @@ -993,7 +993,9 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase): except subprocess.CalledProcessError as exc: raise AssertionError('openssl pkcs12 failed (%d): %s' % (exc.returncode, exc.output)) - def checkMessageProxyProtocol(self, receivedProxyPayload, source, destination, isTCP, values=[], v6=False, sourcePort=None, destinationPort=None): + def checkMessageProxyProtocol(self, receivedProxyPayload, source, destination, isTCP, values=None, v6=False, sourcePort=None, destinationPort=None): + if values is None: + values = [] proxy = ProxyProtocol() self.assertTrue(proxy.parseHeader(receivedProxyPayload)) self.assertEqual(proxy.version, 0x02) -- 2.47.3