使用tweepy的Python中的urllib3连接错误

时间:2019-04-01 03:44:49

标签: python twitter tweepy

我编写了一个程序,该程序将推文抓取并将其放入使用python 3.5和Tweepy 3.7的MySQL服务器中。在我收到以下错误之前的一天,该程序运行良好,没有任何问题。

由于无法确定错误的含义,因此我无法尝试修复它。除了第357行(Tweepy流函数)外,它没有真正引用代码的任何特定部分。

Traceback (most recent call last):
  File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\http\client.py", line 563, in _readinto_chunked
n = self._safe_readinto(mvb)
  File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\http\client.py", line 610, in _safe_readinto
raise IncompleteRead(bytes(mvb[0:total_bytes]), len(b))
    http.client.IncompleteRead: IncompleteRead(0 bytes read, 512 more expected)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\urllib3\response.py", line 302, in _error_catcher
yield
      File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
      File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\http\client.py", line 433, in read
n = self.readinto(b)
      File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\http\client.py", line 463, in readinto
return self._readinto_chunked(b)
      File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\http\client.py", line 574, in _readinto_chunked
raise IncompleteRead(bytes(b[0:total_bytes]))
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/dmnte/PycharmProjects/sql_prac/tweepy_stream_secinfo.py", line 357, in <module>
tweepy_stream.filter(track=['phishing'.......])
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 453, in filter
self._start(is_async)
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 368, in _start
self._run()
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 300, in _run
six.reraise(*exc_info)
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\six.py", line 693, in reraise
raise value
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 269, in _run
self._read_loop(resp)
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 319, in _read_loop
line = buf.read_line()
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\tweepy\streaming.py", line 181, in read_line
self._buffer += self._stream.read(self._chunk_size)
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\urllib3\response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "C:\Users\dmnte\AppData\Local\Programs\Python\Python35\Lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
  File "C:\Users\dmnte\PycharmProjects\cabby\venv\lib\site-packages\urllib3\response.py", line 320, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

我可以从哪里开始寻找解决此错误的方法?

0 个答案:

没有答案