0

当我突然收到错误消息时,我想使用 pyftpdlib 在 Windows 上设置一个 ftp 服务器。

我想运行这个:

from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from pyftpdlib.contrib.authorizers import WindowsAuthorizer

authorizer = WindowsAuthorizer()
authorizer = WindowsAuthorizer(anonymous_user="guest", anonymous_password="1234")
handler = FTPHandler
handler.authorizer = authorizer
server = FTPServer(('', 2121), handler)
server.serve_forever()

但是当我想导入“WindowsAuthorizer”时,我收到了这个错误消息:

from pyftpdlib.contrib.authorizers import WindowsAuthorizer c:\Program Files\Python27\lib\site-packages\pyftpdlib\contrib__init__.py:3: Dep recationWarning: pyftpdlib.contrib namespace is deprecated
_depwarn("pyftpdlib.contrib namespace is deprecated") c:\Program Files\Python27\lib\site-packages\pyftpdlib\contrib\authorizers.py:35: DeprecationWarning: pyftpdlib.contrib.authorizers 模块已弃用;使用 pyf tpdlib.authorizers 代替
_depwarn("pyftpdlib.contrib.authorizers 模块已弃用;"

我真的不知道是什么问题,我已经安装了 pywin32。

4

1 回答 1

0

这看起来像是警告,而不是错误

代码中有打印,上面写着这样

_depwarn("pyftpdlib.contrib.authorizers module is deprecated; "
         "use pyftpdlib.authorizers instead")

这意味着这个语句应该从

from pyftpdlib.contrib.authorizers import WindowsAuthorizer

from pyftpdlib.authorizers import WindowsAuthorizer
于 2014-02-24T05:51:30.600 回答