From b42dafb085d8649f83a4e9e032dcbf72aa4d3855 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 31 May 2022 11:01:09 -0400 Subject: [PATCH] Fix python 3.9 compatibility In python 3.9, the % is no longer included in the first member of the address tuple. Handle both scenarios by adding '%' in for versions that seem to want to remove it. --- confluent_server/confluent/discovery/protocols/ssdp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index d483e7fc..762b643a 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -281,6 +281,8 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None): def _get_svrip(peerdata): for addr in peerdata['addresses']: if addr[0].startswith('fe80::'): + if '%' not in addr[0]: + return addr[0] + '%{0}'.format(addr[3]) return addr[0] return peerdata['addresses'][0][0]