Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101594 > unrolled thread

SSL certification fails / tweepy

Started by"K. Elo" <maillists@pp.inet.fi>
First post2016-01-13 08:46 +0200
Last post2016-01-13 08:46 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  SSL certification fails / tweepy "K. Elo" <maillists@pp.inet.fi> - 2016-01-13 08:46 +0200

#101594 — SSL certification fails / tweepy

From"K. Elo" <maillists@pp.inet.fi>
Date2016-01-13 08:46 +0200
SubjectSSL certification fails / tweepy
Message-ID<mailman.89.1452674969.13488.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web