mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
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>
This commit is contained in:
parent
fc342c62e0
commit
ad817cd5c4
2 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue