mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +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
|
|
@ -606,6 +606,18 @@ class TestFTPClass(TestCase):
|
|||
self.assertEqual(self.server.handler_instance.last_received_cmd, 'quit')
|
||||
self.assertFalse(is_client_connected())
|
||||
|
||||
def test_parse257(self):
|
||||
self.assertEqual(ftplib.parse257('257 "/foo/bar"'), '/foo/bar')
|
||||
self.assertEqual(ftplib.parse257('257 "/foo/bar" created'), '/foo/bar')
|
||||
self.assertEqual(ftplib.parse257('257 ""'), '')
|
||||
self.assertEqual(ftplib.parse257('257 "" created'), '')
|
||||
self.assertRaises(ftplib.error_reply, ftplib.parse257, '250 "/foo/bar"')
|
||||
# The 257 response is supposed to include the directory
|
||||
# name and in case it contains embedded double-quotes
|
||||
# they must be doubled (see RFC-959, chapter 7, appendix 2).
|
||||
self.assertEqual(ftplib.parse257('257 "/foo/b""ar"'), '/foo/b"ar')
|
||||
self.assertEqual(ftplib.parse257('257 "/foo/b""ar" created'), '/foo/b"ar')
|
||||
|
||||
|
||||
class TestIPv6Environment(TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue