Skip to content

Commit f882949

Browse files
jeremyhyltonzware
authored andcommitted
Update request.py
Change error string for ftp error to be consistent with other errors reported for ftp
1 parent 04da723 commit f882949

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/urllib/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ def ftp_open(self, req):
15551555
headers = email.message_from_string(headers)
15561556
return addinfourl(fp, headers, req.full_url)
15571557
except ftplib.all_errors as exp:
1558-
raise URLError(exp.args[0]) from exp
1558+
raise URLError(f"ftp error: {exp}") from exp
15591559

15601560
def connect_ftp(self, user, passwd, host, port, dirs, timeout):
15611561
return ftpwrapper(user, passwd, host, port, dirs, timeout,

0 commit comments

Comments
 (0)