diff options
Diffstat (limited to 'test/functional/test_framework/authproxy.py')
-rw-r--r-- | test/functional/test_framework/authproxy.py | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index 61f92aeac3..f7765a9dfa 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -39,7 +39,6 @@ from http import HTTPStatus import http.client import json import logging -import os import socket import time import urllib.parse @@ -94,36 +93,14 @@ class AuthServiceProxy(): def _request(self, method, path, postdata): ''' - Do a HTTP request, with retry if we get disconnected (e.g. due to a timeout). - This is a workaround for https://bugs.python.org/issue3566 which is fixed in Python 3.5. + Do a HTTP request. ''' headers = {'Host': self.__url.hostname, 'User-Agent': USER_AGENT, 'Authorization': self.__auth_header, 'Content-type': 'application/json'} - if os.name == 'nt': - # Windows somehow does not like to re-use connections - # TODO: Find out why the connection would disconnect occasionally and make it reusable on Windows - # Avoid "ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine" - self._set_conn() - try: - self.__conn.request(method, path, postdata, headers) - return self._get_response() - except (BrokenPipeError, ConnectionResetError): - # Python 3.5+ raises BrokenPipeError when the connection was reset - # ConnectionResetError happens on FreeBSD - self.__conn.close() - self.__conn.request(method, path, postdata, headers) - return self._get_response() - except OSError as e: - # Workaround for a bug on macOS. See https://bugs.python.org/issue33450 - retry = '[Errno 41] Protocol wrong type for socket' in str(e) - if retry: - self.__conn.close() - self.__conn.request(method, path, postdata, headers) - return self._get_response() - else: - raise + self.__conn.request(method, path, postdata, headers) + return self._get_response() def get_request(self, *args, **argsn): AuthServiceProxy.__id_count += 1 |