I am trying to access BitBucket repository using bitbucket-api in python. I am able to run below code successfully.
>>> from bitbucket.bitbucket import Bitbucket
>>> bb = Bitbucket(USERNAME, PASSWORD, 'private_slug')
But When I run below command getting error.
>>> success, result = bb.repository.get()Traceback (most recent call last):
File "D:\Program Files\lib\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "D:\Program Files\lib\urllib3\util\connection.py", line 83, in create_connection
raise err
File "D:\Program Files\lib\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Program Files\lib\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "D:\Program Files\lib\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "D:\Program Files\lib\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "D:\Program Files\lib\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "D:\Program Files\lib\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 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Program Files\lib\requests\adapters.py", line 440, in send
timeout=timeout
File "D:\Program Files\lib\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "D:\Program Files\lib\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
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',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
r = requests.get(url, auth=('username', 'password'), headers=headers)
File "D:\Program Files\lib\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "D:\Program Files\lib\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Program Files\lib\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "D:\Program Files\lib\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "D:\Program Files\lib\requests\adapters.py", line 508, in send
raise ConnectionError(e, request=request)
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',))
I have checked proxy setting as well. Any help would be greatly appreciated.
Hi @Kailash Patra ,
Another option to use is Stashy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.