我在这个简单的连接/列表示例中出错了什么? (我使用python 3.3)
import ftplib
ftp = ftplib.FTP_TLS()
ftp.connect('localhost', 221, 20)
ftp.login()
ftp.prot_p()
ftp.retrlines('LIST')
来源:https://docs.python.org/2/library/ftplib.html#ftplib.FTP_TLS
错误输出:
Traceback (most recent call last):
File "C:/projects/nipples/ftps_client.py", line 10, in <module>
ftp.login()
File "C:\Python33\lib\ftplib.py", line 703, in login
self.auth()
File "C:\Python33\lib\ftplib.py", line 719, in auth
ssl_version=self.ssl_version)
File "C:\Python33\lib\ssl.py", line 630, in wrap_socket
ciphers=ciphers)
File "C:\Python33\lib\ssl.py", line 350, in __init__
raise x
File "C:\Python33\lib\ssl.py", line 346, in __init__
self.do_handshake()
File "C:\Python33\lib\ssl.py", line 553, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:548)
提前致谢。