mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
#1726172: dont raise an unexpected IndexError if a voidresp() call has an empty response.
This commit is contained in:
parent
5d19610f8d
commit
50ba6e1b50
2 changed files with 3 additions and 3 deletions
|
@ -221,7 +221,7 @@ class FTP:
|
||||||
def voidresp(self):
|
def voidresp(self):
|
||||||
"""Expect a response beginning with '2'."""
|
"""Expect a response beginning with '2'."""
|
||||||
resp = self.getresp()
|
resp = self.getresp()
|
||||||
if resp[0] != '2':
|
if resp[:1] != '2':
|
||||||
raise error_reply, resp
|
raise error_reply, resp
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
@ -520,8 +520,6 @@ class FTP:
|
||||||
resp = self.sendcmd('DELE ' + filename)
|
resp = self.sendcmd('DELE ' + filename)
|
||||||
if resp[:3] in ('250', '200'):
|
if resp[:3] in ('250', '200'):
|
||||||
return resp
|
return resp
|
||||||
elif resp[:1] == '5':
|
|
||||||
raise error_perm, resp
|
|
||||||
else:
|
else:
|
||||||
raise error_reply, resp
|
raise error_reply, resp
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue 1726172: fix IndexError in the case of and empty response in ftplib.
|
||||||
|
|
||||||
- Issue 2625: added missing iteritems() call to the for loop in
|
- Issue 2625: added missing iteritems() call to the for loop in
|
||||||
mailbox.MH.get_message().
|
mailbox.MH.get_message().
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue