diff options
author | Carl Meyer <carl@oddbird.net> | 2022-10-10 01:59:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 01:59:07 (GMT) |
commit | ad817cd5c44416da3752ebf9baf16d650703275c (patch) | |
tree | 1e22d326bc21b489dac618e21b61584b6afa4691 /Lib/urllib | |
parent | fc342c62e0debb194d60e79b37e346bf8d940d7a (diff) | |
download | cpython-ad817cd5c44416da3752ebf9baf16d650703275c.zip cpython-ad817cd5c44416da3752ebf9baf16d650703275c.tar.gz cpython-ad817cd5c44416da3752ebf9baf16d650703275c.tar.bz2 |
bpo-43564: preserve original exception in args of FTP URLError (#24938)
* bpo-43564: preserve original error in args of FTP URLError
* Add NEWS blurb
Co-authored-by: Carl Meyer <carljm@instagram.com>
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index e2d5b8c..278aa3a 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1582,7 +1582,7 @@ class FTPHandler(BaseHandler): headers = email.message_from_string(headers) return addinfourl(fp, headers, req.full_url) except ftplib.all_errors as exp: - raise URLError(f'ftp error: {exp}') from exp + raise URLError(exp) from exp def connect_ftp(self, user, passwd, host, port, dirs, timeout): return ftpwrapper(user, passwd, host, port, dirs, timeout, |