Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream aborting because of ProtocolError #798

Closed
remram44 opened this issue Oct 12, 2016 · 1 comment
Closed

Stream aborting because of ProtocolError #798

remram44 opened this issue Oct 12, 2016 · 1 comment
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate

Comments

@remram44
Copy link
Contributor

I got this traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/remram/twitter_colormap_bot/twitter_colormap/__main__.py", line 2, in <module>
    main()
  File "/home/remram/twitter_colormap_bot/twitter_colormap/main.py", line 81, in main
    get_twitter_statuses(handle_status_wrapper, track=['python', 'matplotlib', 'dataviz', 'heatmap'])
  File "/home/remram/twitter_colormap_bot/twitter_colormap/twitter_stream.py", line 45, in get_twitter_statuses
    stream.filter(**kwargs)
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/tweepy/streaming.py", line 449, in filter
    self._start(async)
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/tweepy/streaming.py", line 363, in _start
    self._run()
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/tweepy/streaming.py", line 263, in _run
    self._read_loop(resp)
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/tweepy/streaming.py", line 313, in _read_loop
    line = buf.read_line()
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/tweepy/streaming.py", line 179, in read_line
    self._buffer += self._stream.read(self._chunk_size)
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 320, in read
    flush_decoder = True
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/remram/twitter_colormap_bot/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 246, in _error_catcher
    raise ProtocolError('Connection broken: %r' % e, e)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

It seems that the exceptions caught in Stream#_run are not wide enough.

benfei pushed a commit to benfei/tweepy that referenced this issue Oct 16, 2016
This should handle both cases of incomplete read catched by requests, or
catched by tweepy.

This resolves tweepy#237, resolves tweepy#448, resolves tweepy#536, resolves tweepy#650,
resolves tweepy#691, resolves tweepy#798.

Similar to tweepy#498.
@Harmon758
Copy link
Member

Duplicate of #237

@Harmon758 Harmon758 marked this as a duplicate of #237 Apr 26, 2019
@Harmon758 Harmon758 added Bug This is regarding a bug with the library Duplicate This is a duplicate labels Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is regarding a bug with the library Duplicate This is a duplicate
Projects
None yet
Development

No branches or pull requests

2 participants