From d5690203fcd88f019e9c71a3411643e3cb8839d1 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Sat, 8 Aug 2020 16:47:31 +0100 Subject: [PATCH] Fix critical exception when parsing a URL with a ] e.g.: square Causes urllib to raise a ValueError: File "/usr/lib/python3.8/site-packages/linkcheck/url.py", line 315, in url_norm line: urlparts = list(urllib.parse.urlsplit(url)) locals: urlparts = list = urllib = urllib.parse = urllib.parse.urlsplit = url = 'http://localhost]', len = 17 File "/usr/lib/python3.8/urllib/parse.py", line 440, in urlsplit line: raise ValueError("Invalid IPv6 URL") locals: ValueError = --- linkcheck/checker/const.py | 1 + 1 file changed, 1 insertion(+) diff --git a/linkcheck/checker/const.py b/linkcheck/checker/const.py index 0289cbbd..f473ad02 100644 --- a/linkcheck/checker/const.py +++ b/linkcheck/checker/const.py @@ -27,6 +27,7 @@ from dns.exception import DNSException # Catch these exception on syntax checks. ExcSyntaxList = [ LinkCheckerError, + ValueError, ] # Catch these exceptions on content and connect checks. All other