Hi guys,
i am datamining the geolocated tweets for mapping emergencies in the netherlands. this happens by using the #p2000.
for that I use the tweepy modul to filter the stream and write relevant content into our postgres database via psycopg2.
the script works fine but at some time without a proper reason we get following error and we have to restart the script:
Traceback (most recent call last):
File "capture_the_stream_in_plain_json.py", line 113, in <module>
stream.filter(track=['p2000'])
File "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/streaming.py", line 242, in filter
self._start(async)
File "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/streaming.py", line 181, in _start
self._run()
File "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/streaming.py", line 127, in _run
self._read_loop(resp)
File "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/streaming.py", line 159, in _read_loop
c = resp.read(1)
File "/usr/lib/python2.7/httplib.py", line 541, in read
return self._read_chunked(amt)
File "/usr/lib/python2.7/httplib.py", line 586, in _read_chunked
raise IncompleteRead(''.join(value))
httplib.IncompleteRead: IncompleteRead(0 bytes read)
is this a known error or does anybody have an idea to fix this? please find the script attached.
best,
bern