diff options
author | Gregory P. Smith <greg@krypto.org> | 2019-05-01 20:39:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 20:39:21 (GMT) |
commit | b7378d77289c911ca6a0c0afaf513879002df7d5 (patch) | |
tree | 1102bd7d38307fbaf3d32ee3299ee43a1a64b775 /Lib/http/client.py | |
parent | e1d5dd645d5f59867cb0ad63179110f310cbca89 (diff) | |
download | cpython-b7378d77289c911ca6a0c0afaf513879002df7d5.zip cpython-b7378d77289c911ca6a0c0afaf513879002df7d5.tar.gz cpython-b7378d77289c911ca6a0c0afaf513879002df7d5.tar.bz2 |
bpo-30458: Use InvalidURL instead of ValueError. (GH-13044)
Use http.client.InvalidURL instead of ValueError as the new error case's exception.
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r-- | Lib/http/client.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index 99d6a68..f71a062 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -1091,7 +1091,7 @@ class HTTPConnection: url = '/' # Prevent CVE-2019-9740. if match := _contains_disallowed_url_pchar_re.search(url): - raise ValueError(f"URL can't contain control characters. {url!r} " + raise InvalidURL(f"URL can't contain control characters. {url!r} " f"(found at least {match.group()!r})") request = '%s %s %s' % (method, url, self._http_vsn_str) |