-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
How to handle IncompleteRead errors while streaming #1557
Comments
I have been having this same issue, it will be solved in the next release I believe. I think the fix has been pushed to the main branch already but I was having issues installing from the main branch, but I believe that's one option to fix this before the release of 4.0. EDIT: I do wonder if we could fix the problem temporarily by using a prior tweepy version. |
I've encountered this problem quite a few times and came up with a work around. I created an asynchronous function that runs in the background and checks every so often if the stream is still running. If it's not, it will create another. It looks something like this:
The sleep statement immediately after the if statement may not be needed, but I added it incase the API got mad that another stream was created so quick. Hopefully this helps you. |
Thanks so much for this, I will try it out shortly. |
I already applied 68e19cc changes on my streaming.py file, I stil get the error as I mentioned |
You should install from the main branch instead of applying the changes on your own, see the readme.md for instructions on how to do that. You'll also want to subclass Streaming instead of StreamListener because those classes have been merged in the master branch version of Tweepy. |
Applying individual commits from the master branch to an older version is ill-advised, as there can likely be context missing from additional prior or subsequent commits on the master branch. Regardless, even if 68e19cc was applied to v3.10 in the relevant parts of the code, that traceback would not be possible, since the error being raised is handled with that commit. Manually modifying Tweepy itself is not reproducible and will not be supported. Instead, as noted, if you really need a change that hasn't been released yet, you should install the development version on the master branch, but there are other breaking changes currently on the master branch that you'll need to take into consideration. Otherwise, you should see the referenced issues for the likely cause of this issue. Feel free to create a new issue if you're still able to reproduce this using the master branch. |
Everytime I run my code for a long time, I get that type of error:
I already try to edit streaming.py like here
I have no idea how to fix it, any help is welcomed
The text was updated successfully, but these errors were encountered: