SSL certification fails / tweepy

K. Elo maillists at pp.inet.fi
Wed Jan 13 01:46:15 EST 2016


Dear list members!

I have written I small python script for twitter mining utilising the 
'tweepy' library. Since a couple of days I cannot use the script 
anymore, due to a "ssl certificate verification failed" error. The 
authentication with Twitter API succeess, but when I try to run the 
following code:

--- snip ---

api=tweepy.API(auth)   # 'auth' is my authentification token
print("Receiving network members for '", user_to_track, "' ... ")
network_members = []

#
# The user wants to get all followers of a twitter user
#
while True:
    try:
       for page in tweepy.Cursor(api.followers_ids, user_to_track).pages():
          network_members.extend(page)
          print("Current follower count: ", len(network_members))
          if len(page)==5000: time.sleep(60)
       break
    except tweepy.TweepError as e:
       # Did we exceed the rate limit?
       if e.message[0]["code"]==88:
          # Yes -> sleep for 15 minutes and then continue
          print("Rate limit exceeded, sleeping for 15 minutes ...")
          time.sleep(15*60)
          continue
       else:
          # Something else went wrong -> break out from the loop!
          print("Exception: ", e.message[0], " (", e.code[0], ") --> 
interrupting, sorry!")
          break

--- snip ---

the execution is broken with an "ŚSL_VERIFICATION_FAILED" error.

I have tried both python 2.7 and 3.x, no difference :( I have also 
upgraded 'tweepy', no help.

I suspect this being somehow related to my current system, i.e. openSuSE 
Tumbleweed. I tested the script on a ubuntu system and encountered no 
problems... But I need to get the script running also with my openSuSE :)

Any ideas what could be causing this weird problem?

Thanks in advance!

Kimmo



More information about the Python-list mailing list