I've been helping someone debug an issue with accessing the API
through python
"I am running Python 2.7.5 on WinXP Pro SP3 machine. Unfortunately,
I can't change the Python installation on that machine right now.
I don't know enough about Python to understand why, but the
following FRC API script works fine:
from urllib2 import Request, urlopen
fsuffix="m.xml";
URLprefix="https://frc-api.firstinspires.org/api/v1.0/matches/2016/"
URLsuffix="?tournamentLevel=qual"
headers = {'Accept': 'application/xml', 'Authorization': 'Basic [redacted]'}
def get_data(event):
fname=event+fsuffix
URL = URLprefix + event + URLsuffix
request = Request(URL, headers=headers)
data = urlopen(request).read()
f = open(fname,'w')
f.write(data)
f.close()
get_data("SCMB")
"
However, running this script:
https://gist.github.com/phil-lopreia...ad6e8d5d32d4b3
causes these errors:
Traceback (most recent call last):
File "z.py", line 18, in <module>
result = fetch_endpoint('event/{}'.format(event_key))
File "z.py", line 12, in fetch_endpoint
response = urllib2.urlopen(url)
File "K:\PYTHON27\lib\urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "K:\PYTHON27\lib\urllib2.py", line 404, in open
response = self._open(req, data)
File "K:\PYTHON27\lib\urllib2.py", line 422, in _open
'_open', req)
File "K:\PYTHON27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "K:\PYTHON27\lib\urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "K:\PYTHON27\lib\urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 1] _ssl.c:504:
error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal
error>.
Does anybody have any idea what the issue could be?
Phil
--
Phil Lopreiato