0

I am having problems with Python and Bit Bucket. To display/pull/push do anything really.

I am looking @ Two different libs, atlassian-python-api, and stashy, both seem to have problems my code is very simple:

from atlassian import Bitbucket
import getpass

username = input("What is your username: ")
password = getpass.getpass(prompt="Enter your password?: ")

bitbucket = Bitbucket(
    url="https://website.com:port/projects/demo_projects/repppos/",
    username=username,
    password=password)

data = bitbucket.project_list()

both give me this error: using stashy and another library. I heard someone suggest to use Rest API but I have no experience with this?

Traceback (most recent call last):
  File "C:/Users/User/PycharmProjects/ProjectName/terrafw_gui/test_no_gui.py", line 12, in <module>
    data = bitbucket.project_list()
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\atlassian\bitbucket.py", line 22, in project_list
    return (self.get('rest/api/1.0/projects', params=params) or {}).get('values')
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\atlassian\rest_client.py", line 208, in get
    trailing=trailing)
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\atlassian\rest_client.py", line 151, in request
    files=files
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\adapters.py", line 174, in send
    timeout=timeout
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 417, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 232, in _get_conn
    return conn or self._new_conn()
  File "C:\Users\User\PycharmProjects\ProjectName\venv\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 547, in _new_conn
    strict=self.strict)
TypeError: __init__() got an unexpected keyword argument 'strict'

Process finished with exit code 1

I cannot figure out how come, or why I am getting these error messages without an attempted connection (the error is given immediately without any seconds for timeout).

Alehandro
  • 39
  • 8
  • Possibly the extra p in repppos? – Rich L Feb 28 '20 at 13:58
  • Sorry that I added just to obscure, directories, its written properly in my code, but more so is the issue of the error being spat out without even a delay of a second...meaning I can tell, just by even simply understanding the "ping" command, that no connection is attempted, error is immediate. "Making me assume its a timeout issue, but I feel like its some sort of client side (my configuration issue: I as looking at making Rest API calls, to do the same thing, is this recommended?) Most of these libs are outdated by a few years, so I think thats why I am having these problems. – Alehandro Feb 28 '20 at 14:25
  • Have you tried the base url with the `atlassian-python-api`, i.e. without `/projects/demo_projects/repppos/`? See examples in the [documentation](https://atlassian-python-api.readthedocs.io/) – buddemat Mar 29 '21 at 20:55

0 Answers0