Python slackclient“操作超时”错误

时间:2018-10-26 08:59:24

标签: python websocket slack-api

我正在尝试在python(3.x)中构建一个slack-bot,为此,我正在使用slackClient

运行了未知的小时数后,引发了“ TimeoutError:[Errno 110]操作超时”异常。

日志:

command, channel, user = parse_bot_commands(slack_client.rtm_read())
  File "/usr/local/lib/python3.5/site-packages/slackclient/client.py", line 235, in rtm_read
    json_data = self.server.websocket_safe_read()
  File "/usr/local/lib/python3.5/site-packages/slackclient/server.py", line 278, in websocket_safe_read
    data += "{0}\n".format(self.websocket.recv())
  File "/usr/local/lib/python3.5/site-packages/websocket/_core.py", line 302, in recv
    opcode, data = self.recv_data()
  File "/usr/local/lib/python3.5/site-packages/websocket/_core.py", line 319, in recv_data
    opcode, frame = self.recv_data_frame(control_frame)
  File "/usr/local/lib/python3.5/site-packages/websocket/_core.py", line 332, in recv_data_frame
    frame = self.recv_frame()
  File "/usr/local/lib/python3.5/site-packages/websocket/_core.py", line 366, in recv_frame
    return self.frame_buffer.recv_frame()
  File "/usr/local/lib/python3.5/site-packages/websocket/_abnf.py", line 361, in recv_frame
    self.recv_header()
  File "/usr/local/lib/python3.5/site-packages/websocket/_abnf.py", line 309, in recv_header
    header = self.recv_strict(2)
  File "/usr/local/lib/python3.5/site-packages/websocket/_abnf.py", line 396, in recv_strict
    bytes_ = self.recv(min(16384, shortage))
  File "/usr/local/lib/python3.5/site-packages/websocket/_core.py", line 441, in _recv
    return recv(self.sock, bufsize)
  File "/usr/local/lib/python3.5/site-packages/websocket/_socket.py", line 81, in recv
    bytes_ = sock.recv(bufsize)
  File "/usr/local/lib/python3.5/ssl.py", line 922, in recv
    return self.read(buflen)
  File "/usr/local/lib/python3.5/ssl.py", line 799, in read
    return self._sslobj.read(len, buffer)
  File "/usr/local/lib/python3.5/ssl.py", line 585, in read
    v = self._sslobj.read(len)
TimeoutError: [Errno 110] Operation timed out

代码:

slack-bot-github

0 个答案:

没有答案