mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Patch #1359217: Ignore 2xx response before 150 response.
Will backport to 2.5.
This commit is contained in:
parent
056dac1bcf
commit
36cbc08f3f
2 changed files with 14 additions and 0 deletions
|
@ -325,6 +325,14 @@ class FTP:
|
||||||
if rest is not None:
|
if rest is not None:
|
||||||
self.sendcmd("REST %s" % rest)
|
self.sendcmd("REST %s" % rest)
|
||||||
resp = self.sendcmd(cmd)
|
resp = self.sendcmd(cmd)
|
||||||
|
# Some servers apparently send a 200 reply to
|
||||||
|
# a LIST or STOR command, before the 150 reply
|
||||||
|
# (and way before the 226 reply). This seems to
|
||||||
|
# be in violation of the protocol (which only allows
|
||||||
|
# 1xx or error messages for LIST), so we just discard
|
||||||
|
# this response.
|
||||||
|
if resp[0] == '2':
|
||||||
|
resp = self.getresp()
|
||||||
if resp[0] != '1':
|
if resp[0] != '1':
|
||||||
raise error_reply, resp
|
raise error_reply, resp
|
||||||
else:
|
else:
|
||||||
|
@ -332,6 +340,9 @@ class FTP:
|
||||||
if rest is not None:
|
if rest is not None:
|
||||||
self.sendcmd("REST %s" % rest)
|
self.sendcmd("REST %s" % rest)
|
||||||
resp = self.sendcmd(cmd)
|
resp = self.sendcmd(cmd)
|
||||||
|
# See above.
|
||||||
|
if resp[0] == '2':
|
||||||
|
resp = self.getresp()
|
||||||
if resp[0] != '1':
|
if resp[0] != '1':
|
||||||
raise error_reply, resp
|
raise error_reply, resp
|
||||||
conn, sockaddr = sock.accept()
|
conn, sockaddr = sock.accept()
|
||||||
|
|
|
@ -98,6 +98,9 @@ Core and builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Patch #1359217: Process 2xx response in an ftplib transfer
|
||||||
|
that precedes an 1xx response.
|
||||||
|
|
||||||
- Patch #1355023: support whence argument for GzipFile.seek.
|
- Patch #1355023: support whence argument for GzipFile.seek.
|
||||||
|
|
||||||
- Patch #1065257: Support passing open files as body in
|
- Patch #1065257: Support passing open files as body in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue