Since bpo-29651, the urllib.parse docs say:
> Unmatched square brackets in the netloc attribute will raise a ValueError.
However, when there are at least one [ and ], but they don't match, there's somewhat inconsistent behavior:
>>> urllib.parse.urlparse('http://[::1]]').hostname
'::1'
>>> urllib.parse.urlparse('http://[[::1]').hostname
'[::1'

I confirm violation of https://tools.ietf.org/html/rfc3986#section-3.2.2 .
URLs are now covered by RFC 3986 which obsoletes RFC 1808 that `urllib's documentation refers to.
This new URL RFC adds [] to 'reserved' characters, so them being present unquoted anywhere where reserved characters are not allowed shall be a parsing error.