Closed esdalmaijer closed 8 years ago
This commit should fix this issue. If it doesn't, it'll be because the OAuth expired. The solution to that would be to store the access tokens, but that would be a bit iffy... (We'll worry about that when the time comes.)
The Twitter library will sometimes return
{'hangup':True}
instead of a typical tweet dictionary. This occurs on a Stream SSLError (see this commit in thetwitter
library). Calling on an iterator after this disconnect will cause aStopIteration
exception.This will crash the
_autoreplythread
, which assumes certain keys will be in the tweet dict. In addtion, it relies on a working TwitterStream. Two changes are necessary to fix this:'hangup' in tweet.keys()
. If it is, the TwitterStream should be restarted (see change 2), and the current tweet should not be processed._reanimate
method to restart the Twitter connection. To be safe, restart both_t
(Twitter login) and_ts
(TwitterStream).NOTE: A call to
_reanimate
should also be added to_autotweet
's try-except for posting a new Tweet.