From 66f98c80e84d383ae8ed5438aa1e882b336622fe Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Thu, 12 Sep 2024 10:06:43 +0200 Subject: [PATCH] Use None instead of empty string in socket.getaddrinfo() port (#3160) The only reason there was an empty string is python 2.7 compatibility. Close #3144 --- patroni/validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroni/validator.py b/patroni/validator.py index 04588421..16a53d23 100644 --- a/patroni/validator.py +++ b/patroni/validator.py @@ -144,7 +144,7 @@ def validate_host_port(host_port: str, listen: bool = False, multiple_hosts: boo for host in hosts: # Check if "socket.IF_INET" or "socket.IF_INET6" is being used and instantiate a socket with the identified # protocol - proto = socket.getaddrinfo(host, "", 0, socket.SOCK_STREAM, 0, socket.AI_PASSIVE) + proto = socket.getaddrinfo(host, None, 0, socket.SOCK_STREAM, 0, socket.AI_PASSIVE) s = socket.socket(proto[0][0], socket.SOCK_STREAM) try: if s.connect_ex((host, port)) == 0: