From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:20:51 +0000 (-0500) Subject: Do not mutate default values X-Git-Tag: rec-5.4.0-alpha1~84^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16490%2Fhead;p=thirdparty%2Fpdns.git Do not mutate default values Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- 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)