我正在尝试用Python编写FTP客户端软件。我尝试实现一种重命名目录的方法:
ftp = FTP()
ftp.connect('host')
ftp.login('usrname', 'pass')
ftp.retrlines('RNFR Builds')
ftp.retrlines('RNTO My_Builds')
但是我一直收到这个错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.5/tkinter/__init__.py", line 1553, in __call__
return self.func(*args)
File "Source.py", line 449, in set_name_from_rename
self.ftpController.ftp.retrlines('RNFR Builds')
File "/usr/lib/python3.5/ftplib.py", line 467, in retrlines
with self.transfercmd(cmd) as conn, \
File "/usr/lib/python3.5/ftplib.py", line 398, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "/usr/lib/python3.5/ftplib.py", line 374, in ntransfercmd
raise error_reply(resp)
ftplib.error_reply: 350 Directory exists, ready for destination name.
我确信我有权重命名该目录。有人可以帮忙吗?
感谢您的帮助。