I am trying to access BitBucket repository using bitbucket-api in python. I am able to run below code successfully.
<span>>>></span> <span>from</span><span> bitbucket</span><span>.</span><span>bitbucket </span><span>import</span> <span>Bitbucket</span>
<span>>>></span><span> bb </span><span>=</span> <span>Bitbucket</span><span>(</span><span>USERNAME</span><span>,</span><span> PASSWORD</span><span>,</span> <span>'private_slug'</span><span>)</span>
But When I run below command getting error.
<span>>>></span><span> success</span><span>,</span><span> result </span><span>=</span><span> bb</span><span>.</span><span>repository</span><span>.</span><span>get</span><span>()</span><span>Traceback (most recent call last):<br> File "D:\Program Files\lib\urllib3\connection.py", line 141, in _new_conn<br> (self.host, self.port), self.timeout, **extra_kw)<br> File "D:\Program Files\lib\urllib3\util\connection.py", line 83, in create_connection<br> raise err<br> File "D:\Program Files\lib\urllib3\util\connection.py", line 73, in create_connection<br> sock.connect(sa)<br>TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond<br><br>During handling of the above exception, another exception occurred:<br><br>Traceback (most recent call last):<br> File "D:\Program Files\lib\urllib3\connectionpool.py", line 601, in urlopen<br> chunked=chunked)<br> File "D:\Program Files\lib\urllib3\connectionpool.py", line 346, in _make_request<br> self._validate_conn(conn)<br> File "D:\Program Files\lib\urllib3\connectionpool.py", line 850, in _validate_conn<br> conn.connect()<br> File "D:\Program Files\lib\urllib3\connection.py", line 284, in connect<br> conn = self._new_conn()<br> File "D:\Program Files\lib\urllib3\connection.py", line 150, in _new_conn<br> self, "Failed to establish a new connection: %s" % e)<br>urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x00000000044A0438>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond<br><br>During handling of the above exception, another exception occurred:<br><br>Traceback (most recent call last):<br> File "D:\Program Files\lib\requests\adapters.py", line 440, in send<br> timeout=timeout<br> File "D:\Program Files\lib\urllib3\connectionpool.py", line 639, in urlopen<br> _stacktrace=sys.exc_info()[2])<br> File "D:\Program Files\lib\urllib3\util\retry.py", line 388, in increment<br> raise MaxRetryError(_pool, url, error or ResponseError(cause))<br>urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='bitbucket.org', port=443): Max retries exceeded with url: /api/1.0/user/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000000044A0438>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))<br><br>During handling of the above exception, another exception occurred:<br><br>Traceback (most recent call last):<br> File "<pyshell#7>", line 1, in <module><br> r = requests.get(url, auth=('username', 'password'), headers=headers)<br> File "D:\Program Files\lib\requests\api.py", line 72, in get<br> return request('get', url, params=params, **kwargs)<br> File "D:\Program Files\lib\requests\api.py", line 58, in request<br> return session.request(method=method, url=url, **kwargs)<br> File "D:\Program Files\lib\requests\sessions.py", line 508, in request<br> resp = self.send(prep, **send_kwargs)<br> File "D:\Program Files\lib\requests\sessions.py", line 618, in send<br> r = adapter.send(request, **kwargs)<br> File "D:\Program Files\lib\requests\adapters.py", line 508, in send<br> raise ConnectionError(e, request=request)<br>requests.exceptions.ConnectionError: HTTPSConnectionPool(host='bitbucket.org', port=443): Max retries exceeded with url: /api/1.0/user/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000000044A0438>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))<br><br></span>I have checked proxy setting as well. Any help would be greatly appreciated.