Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

bitbucket proxy setting python

Winni_Chang October 8, 2019

Hi,

 

Because I want to make every computer which has different proxy setting(or none setting) can run my program, I would like to know how to set proxy in my python program. Or it will produce error: HTTPSConnectionPool(host='git.XXXX.com', port=443): Max retries exceeded with url: /rest/api/1.0/projects/xxx/repos/ooo/tags?limit=1000 (Caused by ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))) 

I think this error is caused by proxy because after I set proxy on some computer, it works.

I use Bitbucket Server and atlassian-python-api module.

My program is as following:

--------------------------------------------------------------------------------------------

from atlassian import Bitbucket

...

bbucket = Bitbucket(url='https://git.XXXX.com', username=username, password=password)

tag = bbucket.get_tags('xxx', 'ooo')

...

--------------------------------------------------------------------------------------------

Is there any methods or other ways can help me? Something like: bitbucket.proxies = {'http':proxy_setting, 'https':proxy_setting}? or command setting?

 

Thanks a lot.

1 answer

1 accepted

0 votes
Answer accepted
Winni_Chang October 8, 2019

Sorry, I found it. Done.

Shenghai Jiang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 22, 2019

how do you do it?

Winni_Chang November 24, 2019

Hi,

 

proxy_setting = http://<username>:<password>@proxy:<portNumber>
bbucket = Bitbucket(url='https://...', username=username, password=password)
bbucket._session.proxies = {'http': proxy_setting, 'https': proxy_setting}

I set it like this and it works. :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events