#!/usr/bin/python3

import pywikibot
from pywikibot import pagegenerators as pg


with open('surnames.rq', 'r') as query_file:
    QUERY = query_file.read().replace('\n', '')

print("query read.....")
print(QUERY)
wikidata_site = pywikibot.Site("wikidata", "wikidata")
print("Wikidata site created...")
generator = pg.WikidataSPARQLPageGenerator(QUERY, site=wikidata_site)
print("generator created....")



for x in generator:
    print("fetching item...")
    item_dict = x.get()
query read.....
SELECT ?item WHERE {  ?item wdt:P31 wd:Q101352.}
Wikidata site created...
ERROR: Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3518a240>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3518a240>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/pwb/pywikibot/data/api.py", line 1957, in submit
    body=body, headers=headers)
  File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 322, in request
    r = fetch(baseuri, method, params, body, headers, **kwargs)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 511, in fetch
    error_handling_callback(request)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 398, in error_handling_callback
    raise request.data
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 377, in _http_process
    verify=not ignore_validation)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3518a240>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

WARNING: Waiting 5 seconds before retrying.
ERROR: Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517eef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517eef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/pwb/pywikibot/data/api.py", line 1957, in submit
    body=body, headers=headers)
  File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 322, in request
    r = fetch(baseuri, method, params, body, headers, **kwargs)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 511, in fetch
    error_handling_callback(request)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 398, in error_handling_callback
    raise request.data
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 377, in _http_process
    verify=not ignore_validation)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517eef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

WARNING: Waiting 10 seconds before retrying.
ERROR: Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517e320>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517e320>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/pwb/pywikibot/data/api.py", line 1957, in submit
    body=body, headers=headers)
  File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 322, in request
    r = fetch(baseuri, method, params, body, headers, **kwargs)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 511, in fetch
    error_handling_callback(request)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 398, in error_handling_callback
    raise request.data
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 377, in _http_process
    verify=not ignore_validation)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a3517e320>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

WARNING: Waiting 20 seconds before retrying.
ERROR: Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a35197cc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/paws/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a35197cc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/paws/pwb/pywikibot/data/api.py", line 1957, in submit
    body=body, headers=headers)
  File "/srv/paws/pwb/pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 322, in request
    r = fetch(baseuri, method, params, body, headers, **kwargs)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 511, in fetch
    error_handling_callback(request)
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 398, in error_handling_callback
    raise request.data
  File "/srv/paws/pwb/pywikibot/comms/http.py", line 377, in _http_process
    verify=not ignore_validation)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/srv/paws/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.wikidata.org', port=443): Max retries exceeded with url: /w/api.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3a35197cc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

WARNING: Waiting 40 seconds before retrying.
---------------------------------------------------------------------------
gaierror                                  Traceback (most recent call last)
/srv/paws/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
    140             conn = connection.create_connection(
--> 141                 (self.host, self.port), self.timeout, **extra_kw)
    142 

/srv/paws/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     59 
---> 60     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     61         af, socktype, proto, canonname, sa = res

/usr/lib/python3.6/socket.py in getaddrinfo(host, port, family, type, proto, flags)
    742     addrlist = []
--> 743     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    744         af, socktype, proto, canonname, sa = res

gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-6-c49f4c56279d> in <module>()
     12 wikidata_site = pywikibot.Site("wikidata", "wikidata")
     13 print("Wikidata site created...")
---> 14 generator = pg.WikidataSPARQLPageGenerator(QUERY, site=wikidata_site)
     15 print("generator created....")
     16 

/srv/paws/pwb/pywikibot/pagegenerators.py in WikidataSPARQLPageGenerator(query, site, item_name, endpoint, entity_url, result_type)
   2783     if not endpoint or not entity_url:
   2784         dependencies['repo'] = repo
-> 2785     query_object = sparql.SparqlQuery(**dependencies)
   2786     data = query_object.get_items(query,
   2787                                   item_name=item_name,

/srv/paws/pwb/pywikibot/data/sparql.py in __init__(self, endpoint, entity_url, repo, max_retries, retry_wait)
     61         if repo:
     62             try:
---> 63                 self.endpoint = repo.sparql_endpoint
     64                 self.entity_url = repo.concept_base_uri
     65             except NotImplementedError:

/srv/paws/pwb/pywikibot/site.py in callee(self, *args, **kwargs)
   1354     def decorator(fn):
   1355         def callee(self, *args, **kwargs):
-> 1356             if MediaWikiVersion(self.version()) < MediaWikiVersion(version):
   1357                 raise NotImplementedError(
   1358                     u'Method or function "%s"\n'

/srv/paws/pwb/pywikibot/site.py in version(self)
   2737             try:
   2738                 version = self.siteinfo.get('generator',
-> 2739                                             expiry=1).split(' ')[1]
   2740             except pywikibot.data.api.APIError:
   2741                 # May occur if you are not logged in (no API read permissions).

/srv/paws/pwb/pywikibot/site.py in get(self, key, get_default, cache, expiry)
   1679                 elif not Siteinfo._is_expired(cached[1], expiry):
   1680                     return copy.deepcopy(cached[0])
-> 1681         preloaded = self._get_general(key, expiry)
   1682         if not preloaded:
   1683             preloaded = self._get_siteinfo(key, expiry)[key]

/srv/paws/pwb/pywikibot/site.py in _get_general(self, key, expiry)
   1625                     .format("', '".join(props)), _logger)
   1626             props += ['general']
-> 1627             default_info = self._get_siteinfo(props, expiry)
   1628             for prop in props:
   1629                 self._cache[prop] = default_info[prop]

/srv/paws/pwb/pywikibot/site.py in _get_siteinfo(self, prop, expiry)
   1550             # warnings are handled later
   1551             request._warning_handler = warn_handler
-> 1552             data = request.submit()
   1553         except api.APIError as e:
   1554             if e.code == 'siunknown_siprop':

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2353         cached_available = self._load_cache()
   2354         if not cached_available:
-> 2355             self._data = super(CachedRequest, self).submit()
   2356             self._write_cache(self._data)
   2357         else:

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   1955                 rawdata = http.request(
   1956                     site=self.site, uri=uri, method='GET' if use_get else 'POST',
-> 1957                     body=body, headers=headers)
   1958             except Server504Error:
   1959                 pywikibot.log(u"Caught HTTP 504 error; retrying")

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1456                              cls, depth)
   1457                     del __kw[old_arg]
-> 1458             return obj(*__args, **__kw)
   1459 
   1460         if not __debug__:

/srv/paws/pwb/pywikibot/comms/http.py in request(site, uri, method, params, body, headers, data, **kwargs)
    320     headers['user-agent'] = user_agent(site, format_string)
    321 
--> 322     r = fetch(baseuri, method, params, body, headers, **kwargs)
    323     return r.content
    324 

/srv/paws/pwb/pywikibot/comms/http.py in fetch(uri, method, params, body, headers, default_error_handling, use_fake_user_agent, data, **kwargs)
    504             headers['user-agent'] = fake_user_agent()
    505 
--> 506     request = _enqueue(uri, method, params, body, headers, **kwargs)
    507     assert(request._data is not None)  # if there's no data in the answer we're in trouble
    508     # Run the error handling callback in the callers thread so exceptions

/srv/paws/pwb/pywikibot/comms/http.py in _enqueue(uri, method, params, body, headers, data, **kwargs)
    461     request = threadedhttp.HttpRequest(
    462         uri, method, params, body, all_headers, callbacks, **kwargs)
--> 463     _http_process(session, request)
    464     return request
    465 

/srv/paws/pwb/pywikibot/comms/http.py in _http_process(session, http_request)
    375         response = session.request(method, uri, params=params, data=body,
    376                                    headers=headers, auth=auth, timeout=timeout,
--> 377                                    verify=not ignore_validation)
    378     except Exception as e:
    379         http_request.data = e

/srv/paws/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    506         }
    507         send_kwargs.update(settings)
--> 508         resp = self.send(prep, **send_kwargs)
    509 
    510         return resp

/srv/paws/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
    616 
    617         # Send the request
--> 618         r = adapter.send(request, **kwargs)
    619 
    620         # Total elapsed time of the request (approximately)

/srv/paws/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    438                     decode_content=False,
    439                     retries=self.max_retries,
--> 440                     timeout=timeout
    441                 )
    442 

/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    599                                                   timeout=timeout_obj,
    600                                                   body=body, headers=headers,
--> 601                                                   chunked=chunked)
    602 
    603             # If we're going to release the connection in ``finally:``, then

/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    344         # Trigger any extra validation we need to do.
    345         try:
--> 346             self._validate_conn(conn)
    347         except (SocketTimeout, BaseSSLError) as e:
    348             # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.

/srv/paws/lib/python3.6/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
    848         # Force connect early to allow us to validate the connection.
    849         if not getattr(conn, 'sock', None):  # AppEngine might not have  `.sock`
--> 850             conn.connect()
    851 
    852         if not conn.is_verified:

/srv/paws/lib/python3.6/site-packages/urllib3/connection.py in connect(self)
    282     def connect(self):
    283         # Add certificate verification
--> 284         conn = self._new_conn()
    285 
    286         hostname = self.host

/srv/paws/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
    139         try:
    140             conn = connection.create_connection(
--> 141                 (self.host, self.port), self.timeout, **extra_kw)
    142 
    143         except SocketTimeout as e:

KeyboardInterrupt: