diff options
| author | Gregory P. Smith <greg@krypto.org> | 2019-05-01 16:39:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-01 16:39:21 -0400 |
| commit | b7378d77289c911ca6a0c0afaf513879002df7d5 (patch) | |
| tree | 1102bd7d38307fbaf3d32ee3299ee43a1a64b775 /Lib/http | |
| parent | e1d5dd645d5f59867cb0ad63179110f310cbca89 (diff) | |
| download | cpython-git-b7378d77289c911ca6a0c0afaf513879002df7d5.tar.gz | |
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')
| -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 99d6a68cf4..f71a062d2b 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) |
