Python TypeError:wrap_socket()获得意外的关键字参数';政策监听器';|gevent socketio

Python TypeError:wrap_socket()获得意外的关键字参数';政策监听器';|gevent socketio,python,gevent,gevent-socketio,Python,Gevent,Gevent Socketio,我是python新手,我正在尝试测试gevent socketio示例,但运气不好。 每次访问html文件时都会出现此错误。在本例中,我发布了从live\u cpu\u graph报告的错误,但是chat也有同样的问题 谢谢你的帮助 Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server) DEPRECATION WARNING: use `namespace` instead of `resour

我是python新手,我正在尝试测试gevent socketio示例,但运气不好。 每次访问html文件时都会出现此错误。在本例中,我发布了从
live\u cpu\u graph
报告的错误,但是
chat
也有同样的问题

谢谢你的帮助

Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server)
DEPRECATION WARNING: use `namespace` instead of `resource`
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45823))> failed with TypeError

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45824))> failed with TypeError

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
    ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45826))> failed with TypeError
在端口上侦听http://0.0.0.0:8080 端口10843上的和(闪存策略服务器)
不推荐使用警告:使用'namespace'而不是'resource'`
回溯(最近一次呼叫最后一次):
文件“/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,第390行,正在运行
结果=self.\u运行(*self.args,**self.kwargs)
文件“/usr/local/lib/python2.7/dist packages/gevent/server.py”,第159行,位于wrap\u socket\u和\u句柄中
ssl\u socket=self.wrap\u socket(客户端\u socket,**self.ssl\u参数)
TypeError:wrap\u socket()获得意外的关键字参数“policy\u listener”

我想我已经下定决心改变这一点:

if __name__ == '__main__':
    print 'Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server)'
    SocketIOServer(('0.0.0.0', 8080), Application(),
        resource="socket.io", policy_server=True,
        policy_listener=('0.0.0.0', 10843)).serve_forever(
为此:

if __name__ == '__main__':
    print 'Listening on port http://0.0.0.0:8080'
    SocketIOServer(('0.0.0.0', 8080), Application(),
        resource="socket.io").serve_forever(
但我真的不知道为什么。我希望有人能解释一下。
谢谢。

我想我已经决定改变这一点:

if __name__ == '__main__':
    print 'Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server)'
    SocketIOServer(('0.0.0.0', 8080), Application(),
        resource="socket.io", policy_server=True,
        policy_listener=('0.0.0.0', 10843)).serve_forever(
为此:

if __name__ == '__main__':
    print 'Listening on port http://0.0.0.0:8080'
    SocketIOServer(('0.0.0.0', 8080), Application(),
        resource="socket.io").serve_forever(
但我真的不知道为什么。我希望有人能解释一下。
谢谢。

同样的问题发生的原因我不知道,但这个简单的把戏也解决了我的问题。同样的问题发生的原因我不知道,但这个简单的把戏也解决了我的问题。