On Wed, 9 Oct 2019 17:15:05 +0300 [email protected] wrote:
> I bumped into the same problem.
>
> It seems it can also be fixed by adding an error handler:
>
> def handle_error(self):
> DEBUG(...)
>
I stumbled into another problem. If someone advertises a proxy with an ipv6
address that is not reachable by the clients, then apt-avahi-discover crashes
with
File "/usr/lib/python2.7/asyncore.py", line 356, in connect
raise socket.error(err, errorcode[err])
socket.error: [Errno 101] ENETUNREACH
A workaround for that is to catch the exception:
try:
hosts.append(AptAvahiClient(addr))
except socket.error:
DEBUG("Socket error, skipping")
But then error handler needs to close the client to avoid an infinite loop:
def handle_error(self):
DEBUG("error")
self.close()