mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-43564: preserve original exception in args of FTP URLError (GH-24938)
* bpo-43564: preserve original error in args of FTP URLError
* Add NEWS blurb
Co-authored-by: Carl Meyer <carljm@instagram.com>
(cherry picked from commit ad817cd5c4
)
Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
parent
21b13c24ba
commit
1d05b58e83
2 changed files with 4 additions and 1 deletions
|
@ -1579,7 +1579,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,
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Wrap network errors consistently in urllib FTP support, so the test suite
|
||||
doesn't fail when a network is available but the public internet is not
|
||||
reachable.
|
Loading…
Add table
Add a link
Reference in a new issue