-
Kirill Smelkov authored
urlparse does not handle raw IPv6 address the way I though it does - extracted hostname is not the whole address, but only the first part of it: In [3]: urllib.parse.urlparse('z://2a11:9ac1:6::5') Out[3]: ParseResult(scheme='z', netloc='2a11:9ac1:6::5', path='', params='', query='', fragment='') In [4]: _.hostname Out[4]: '2a11' Tests did not noticed this because previouslt we had e.g 4321::1 in the address, and netaddr thinks 4321 is valid ipv4 address: In [6]: netaddr.IPAddress('4321') Out[6]: IPAddress('0.0.16.225') However changing IPv6 addresses to use hex letter trigger the bug with e.g. raise AddrFormatError('failed to detect a valid IP ' \ netaddr.core.AddrFormatError: failed to detect a valid IP address from '2a11' -> Fix it by avoiding urlparse and doing ip/port splitting ourselves by hand. /reported-by @lu.xu
414079a6