Unclear error message in WhisperBack when failing to connect to the server
Originally created by @alant on #11136 (Redmine)
As reported by Olivier Berger, when Tails is conected to a network but Tor cannot create a circuit to the destination WhisperBack shows an error with the “too many values to unpack” message, which ain’t exactly end-user friendly.
$ whisperback
Exception in thread Thread-6:
Traceback (most recent call last):
[...]
File "/usr/lib/python3/dist-packages/socks.py", line 459, in
connect dest_addr, dest_port = dest_pair ValueError: too many
values to unpack (expected 2)
socks assumes the host resolves to AF_INET and triggers a ValueError if it’s not the case. If a .onion address is given, it resolves to an AF_INET address and to an AF_INET6 address. If the 1st doesn’t connect, the 2nd is tried, which make socks trigger the ValueError. This issue is fixed upstream in socks, in which this situation raises a socket.error (https://github.com/Anorov/PySocks/commit/4081b79)