3

I've been calling an api (Yelp) and been using it to run a "search" function for multiple locations. It works out okay sometimes, and other times, it gives me back an Error that I am confused about. I'm looking at a lot of locations, so I've been limiting it down to see if theres something wrong with the quantity (which doesnt seem to be the case.) I run the search on 5 locations. It works, but if I run it again, I get an error. Then I run it on 3 locations, it doesnt work. Then I run it on 4, and it happens to work. I try again, and it wont work. I feel like my computer is playing games with me. This is the error I keep getting:

(some code about most recent call)

 File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1240, in https_open
    context=self._context)
  File "C:\Python27\lib\urllib2.py", line 1197, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:590)>

WHAT is going on??!!

mrDinkelman
  • 488
  • 1
  • 9
  • 18
beraiyan
  • 31
  • 5
  • please provider your codes, only with one error message -- to hard to understand what's going wrong ;) – mrDinkelman Dec 29 '15 at 09:54
  • Just glancing at the code, it looks like it might a problem on Yelp's end. So you should provide your relevant code and also the response that the Yelp API gives just prior to the error. – Chris Dec 29 '15 at 21:24
  • Possible duplicate of [Python Requests requests.exceptions.SSLError: \[Errno 8\] \_ssl.c:504: EOF occurred in violation of protocol](http://stackoverflow.com/questions/14102416/python-requests-requests-exceptions-sslerror-errno-8-ssl-c504-eof-occurred) – Fred Thomsen Jan 01 '16 at 20:56

1 Answers1

0

You have not posted your python version or any other version information or done any network trace. However, I have seen a similar issue before with older python versions which send an SSLv2-compatible ClientHello message, which the Yelp API server may no longer supporting. If you are running a version of python prior to 2.7.10, I suspect this is most likely the case.

Some more information on the changes in the python SSL module are available here: https://fossies.org/diffs/Python/2.7.9_vs_2.7.10/Doc/library/ssl.rst-diff.html

Fred Thomsen
  • 1,538
  • 2
  • 13
  • 15