2016-05-30 7 views
0

verwendete ich den folgenden Codetweepy Fehler mit requests.exceptions.SSLError: bad Handshake

auth = tweepy.OAuthHandler(consumer_key, consumer_secret) 
auth.set_access_token(access_token, access_token_secret) 
api = tweepy.API(auth) 
screen_name =[] 

class CustomStreamListener(tweepy.StreamListener): 
    def on_status(self, status): 
     if '#selffile' in status.text.lower(): 
      print status.text #status.author.screen_name 

    def on_error(self, status_code): 
     print >> sys.stderr, 'Encountered error with status code:',  status_code 
     return True # Don't kill the stream 

    def on_timeout(self): 
     print >> sys.stderr, 'Timeout...' 
     return True # Don't kill the stream 
sapi = tweepy.streaming.Stream(auth, CustomStreamListener())  
sapi.filter(locations=[5.0770049095, 47.2982950435, 15.0403900146, 54.9039819757], async=False,follow=None) 

Ich habe folllowing Fehlermeldung.

File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 445, in filter 
self._start(async) 
File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 361, in _start 
self._run() 
File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 294, in _run 
raise exception 
requests.exceptions.SSLError: bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],) 

Hat jemand die Idee, dieses Problem zu lösen?

`

Antwort

0

Twitter nicht mehr unterstützt SSLv3, müssen Sie TLS stattdessen verwenden. Möglicherweise müssen Sie Ihre Version von Tweepy aktualisieren.