---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
379 try: # Python 2.7, use buffering of HTTP responses
--> 380 httplib_response = conn.getresponse(buffering=True)
381 except TypeError: # Python 2.6 and older, Python 3
TypeError: getresponse() got an unexpected keyword argument 'buffering'
During handling of the above exception, another exception occurred:
WantReadError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py in recv_into(self, *args, **kwargs)
279 try:
--> 280 return self.connection.recv_into(*args, **kwargs)
281 except OpenSSL.SSL.SysCallError as e:
C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\SSL.py in recv_into(self, buffer, nbytes, flags)
1714 result = _lib.SSL_read(self._ssl, buf, nbytes)
-> 1715 self._raise_ssl_error(self._ssl, result)
1716
C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\SSL.py in _raise_ssl_error(self, ssl, result)
1520 if error == _lib.SSL_ERROR_WANT_READ:
-> 1521 raise WantReadError()
1522 elif error == _lib.SSL_ERROR_WANT_WRITE:
WantReadError:
During handling of the above exception, another exception occurred:
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-15-dd0cf3feae59> in <module>()
2 for _url in Layers:
3 # Get Metadata
----> 4 metadata = getmetadata(_url)
5 if not metadata == 0:
6 # Metadata to variables
<ipython-input-14-3fa337b8f2dd> in getmetadata(_url)
2 url = _url + '?f=' + req_frmt
3 print("--Getting Metadata fo layer with url", url)
----> 4 response = requests.get(url, headers={'referer': my_referer, 'User-Agent':UserAgent}, timeout=10)
5 if response.status_code == 200:
6 metadata = response.json()
C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py in get(url, params, **kwargs)
70
71 kwargs.setdefault('allow_redirects', True)
---> 72 return request('get', url, params=params, **kwargs)
73
74
C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py in request(method, url, **kwargs)
56 # cases, and look like a memory leak in others.
57 with sessions.Session() as session:
---> 58 return session.request(method=method, url=url, **kwargs)
59
60
C:\ProgramData\Anaconda3\lib\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
C:\ProgramData\Anaconda3\lib\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)
C:\ProgramData\Anaconda3\lib\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
C:\ProgramData\Anaconda3\lib\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
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
381 except TypeError: # Python 2.6 and older, Python 3
382 try:
--> 383 httplib_response = conn.getresponse()
384 except Exception as e:
385 # Remove the TypeError from the exception chain in Python 3;
C:\ProgramData\Anaconda3\lib\http\client.py in getresponse(self)
1329 try:
1330 try:
-> 1331 response.begin()
1332 except ConnectionError:
1333 self.close()
C:\ProgramData\Anaconda3\lib\http\client.py in begin(self)
295 # read until we get a non-100 response
296 while True:
--> 297 version, status, reason = self._read_status()
298 if status != CONTINUE:
299 break
C:\ProgramData\Anaconda3\lib\http\client.py in _read_status(self)
256
257 def _read_status(self):
--> 258 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
259 if len(line) > _MAXLINE:
260 raise LineTooLong("status line")
C:\ProgramData\Anaconda3\lib\socket.py in readinto(self, b)
584 while True:
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
588 self._timeout_occurred = True
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py in recv_into(self, *args, **kwargs)
290 raise
291 except OpenSSL.SSL.WantReadError:
--> 292 rd = util.wait_for_read(self.socket, self.socket.gettimeout())
293 if not rd:
294 raise timeout('The read operation timed out')
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\wait.py in wait_for_read(socks, timeout)
31 or optionally a single socket if passed in. Returns a list of
32 sockets that can be read from immediately. """
---> 33 return _wait_for_io_events(socks, EVENT_READ, timeout)
34
35
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\wait.py in _wait_for_io_events(socks, events, timeout)
24 selector.register(sock, events)
25 return [key[0].fileobj for key in
---> 26 selector.select(timeout) if key[1] & events]
27
28
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\selectors.py in select(self, timeout)
318 ready = []
319 r, w, _ = _syscall_wrapper(self._select, True, self._readers,
--> 320 self._writers, timeout)
321 r = set(r)
322 w = set(w)
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\selectors.py in _syscall_wrapper(func, _, *args, **kwargs)
62 and recalculate their timeouts. """
63 try:
---> 64 return func(*args, **kwargs)
65 except (OSError, IOError, select.error) as e:
66 errcode = None
C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\selectors.py in _select(self, r, w, timeout)
308 def _select(self, r, w, timeout=None):
309 """ Wrapper for select.select because timeout is a positional arg """
--> 310 return select.select(r, w, [], timeout)
311
312 def select(self, timeout=None):
KeyboardInterrupt: