Closed slink2111 closed 6 years ago
Why do you call it like this with internal functions?
The proper use would rather be the simplier:
t_api = twitter.Twitter(domain="api.twitter.com", api_version="1.1", format="json", auth=auth, secure=True)
Is this because you want to tune the timeout argument?
This is exactly the case I need the timeout argument, because without it i see that my script hungs because the unlimited timeout (from default is set to None).
self._check_connected()
timeout = self.gettimeout()
try:
if timeout == 0.0 and block:
self.settimeout(None)
> self._sslobj.do_handshake()
finally:
self.settimeout(timeout)
So with my code i avoid to get the TypeError: init() got an unexpected keyword argument 'timeout' when calling the api.
The execution with the argument secure=False isn't an option, it gives an SSL is required message and returns no data
I guess Twitter ended up forcing ssl connections making the option secure=False
obsolete probably.
To handle the timeout, you shouldn't need to call TwitterCall and can rather use the magic "_" prefixed arguments to use it with the regular calls as explained in the Readme and here: https://github.com/sixohsix/twitter/blob/master/twitter/api.py#L441-L447
For instance:
t_api = twitter.Twitter(domain="api.twitter.com", api_version="1.1", format="json", auth=auth, secure=True)
t_api.search.tweets(q="python", _timeout=15)
Thank you RouxRC i made some digging to the library and i found it my shelf. now my code seems to work like a charm there was no problem with the lib 🥇
all right, I'm closing this issue then, but feel free and reopen it or another if necessary!
I see that my script, stuck here forever /usr/lib/python2.7/ssl.py:
the values of the vars are len = 8192 buffer = None
i call the api using the following code
and everything works till it stops. Now i haven't tried the execution by adding secure=False to the TwitterCall i will and i will give you new feedback.