summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2022-10-10 01:59:07 (GMT)
committerGitHub <noreply@github.com>2022-10-10 01:59:07 (GMT)
commitad817cd5c44416da3752ebf9baf16d650703275c (patch)
tree1e22d326bc21b489dac618e21b61584b6afa4691 /Lib/urllib
parentfc342c62e0debb194d60e79b37e346bf8d940d7a (diff)
downloadcpython-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.py2
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,