gpt4 book ai didi

python - 类型错误 : wrap_socket() got an unexpected keyword argument 'policy_listener' | gevent-socketio

转载 作者:太空宇宙 更新时间:2023-11-03 18:42:35 25 4
gpt4 key购买 nike

我是 python 新手,我正在尝试测试 gevent-socketio 示例,但没有成功。每次访问 html 文件时都会出现此错误。在这种情况下,我发布了 live_cpu_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

最佳答案

我想我已经决定改变这个:

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(

但是我真的不知道为什么。我希望有人能解释一下这一点。谢谢。

关于python - 类型错误 : wrap_socket() got an unexpected keyword argument 'policy_listener' | gevent-socketio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20211702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com