mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
fix issue 9601: ftplib now provides a workaround for invalid response code returned on MKD and PWD by non-compliant FTPserver implementations such as ISS shipped with Windows server 2003
This commit is contained in:
parent
076e031e54
commit
bbc4782d77
3 changed files with 29 additions and 3 deletions
|
@ -565,7 +565,11 @@ class FTP:
|
|||
|
||||
def mkd(self, dirname):
|
||||
'''Make a directory, return its full pathname.'''
|
||||
resp = self.sendcmd('MKD ' + dirname)
|
||||
resp = self.voidcmd('MKD ' + dirname)
|
||||
# fix around non-compliant implementations such as IIS shipped
|
||||
# with Windows server 2003
|
||||
if not resp.startswith('257'):
|
||||
return ''
|
||||
return parse257(resp)
|
||||
|
||||
def rmd(self, dirname):
|
||||
|
@ -574,7 +578,11 @@ class FTP:
|
|||
|
||||
def pwd(self):
|
||||
'''Return current working directory.'''
|
||||
resp = self.sendcmd('PWD')
|
||||
resp = self.voidcmd('PWD')
|
||||
# fix around non-compliant implementations such as IIS shipped
|
||||
# with Windows server 2003
|
||||
if not resp.startswith('257'):
|
||||
return ''
|
||||
return parse257(resp)
|
||||
|
||||
def quit(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue