in gym/gym/scoreboard/client/http_client.py [0:0]
def request(self, method, url, headers, post_data=None, files=None):
global warned
kwargs = {}
# Really, really only turn this off while debugging.
if not self._verify_ssl_certs:
if not warned:
logger.warn('You have disabled SSL cert verification in OpenAI Gym, so we will not verify SSL certs. This means an attacker with control of your network could snoop on or modify your data in transit.')
warned = True
kwargs['verify'] = False
try:
try:
result = self.session.request(method,
url,
headers=headers,
data=post_data,
timeout=200,
files=files,
**kwargs)
except TypeError as e:
raise TypeError(
'Warning: It looks like your installed version of the '
'"requests" library is not compatible with OpenAI Gym\'s'
'usage thereof. (HINT: The most likely cause is that '
'your "requests" library is out of date. You can fix '
'that by running "pip install -U requests".) The '
'underlying error was: %s' % (e,))
# This causes the content to actually be read, which could cause
# e.g. a socket timeout. TODO: The other fetch methods probably
# are susceptible to the same and should be updated.
content = result.content
status_code = result.status_code
except Exception as e:
# Would catch just requests.exceptions.RequestException, but can
# also raise ValueError, RuntimeError, etc.
self._handle_request_error(e, method, url)
if logger.level <= logging.DEBUG:
logger.debug(