0

I am attempting to make a GUI program that will push changes to a Bit Bucket Repository. I have the following code for a TKinter GUI application Button. i keep getting the following errors. Right now I just want to display the repos in the text box that I have also created, but I think I am getting Timeout issues right now? If I am reading the debug log correctly.

    def bitbucket_pull():
    bitbucket = stashy.connect("https://bitbucket.domain.com:port/projects/blahblah/repos/123/",username, password)
    print("""Bitbucket Pull 
        """)
    T.insert(END, bitbucket.projects.list())

but i keep getting this error

Bitbucket Pull

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 1705, in __call__
    return self.func(*args)
  File "C:/Users/user/PycharmProjects/Project/project_gui/main.py", line 118, in bitbucket_pull
    T.insert(END, bitbucket.projects.list())
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\stashy\helpers.py", line 78, in list
    return list(self.all())
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\stashy\helpers.py", line 44, in paginate
    response = self._client.get(url, **kw)
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\stashy\client.py", line 59, in get
    return requests.get(self.url(resource), auth=(self._username, self._password), verify=self._verify, **kw)
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\requests\api.py", line 55, in get
    return request('get', url, **kwargs)
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\requests\api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\user\PycharmProjects\Project\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\Project\venv\lib\site-packages\requests\sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\user\PycharmProjects\Project\venv\lib\site-packages\requests\adapters.py", line 174, in send
    timeout=timeout
  File "C:\Users\user\PycharmProjects\Project\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\Project\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\Project\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'

Since it automatically gives me this error (without any kind of hang), I am assuming that its not actually trying the connection and I have wrote the code wrong, or its timing out immediately.

EDIT: No GUI (new file: test_no_gui.py)

import stashy 
bitbucket = stashy.connect("https://bitbucket.domain.come:port/projects/asdasd/asd/asdadasd/", "username","password")
print(bitbucket.projects.list())

Still gives this error

Traceback (most recent call last):
  File "C:/Users/User/PycharmProjects/Project/ProjectName/test_no_gui.py", line 3, in <module>
    print(bitbucket.projects.list())
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\stashy\helpers.py", line 78, in list
    return list(self.all())
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\stashy\helpers.py", line 44, in paginate
    response = self._client.get(url, **kw)
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\stashy\client.py", line 59, in get
    return requests.get(self.url(resource), auth=(self._username, self._password), verify=self._verify, **kw)
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\requests\api.py", line 55, in get
    return request('get', url, **kwargs)
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\requests\api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\User\PycharmProjects\Project\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\Project\venv\lib\site-packages\requests\sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\User\PycharmProjects\Project\venv\lib\site-packages\requests\adapters.py", line 174, in send
    timeout=timeout
  File "C:\Users\User\PycharmProjects\Project\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\Project\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\Project\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'
Alehandro
  • 39
  • 8
  • Added without using tkinter, as an EDIT: above. Thank you for your quick reply. It seems like its not running a connection regardless as the error gets spat out immediately without any hang or delay (for a timeout) – Alehandro Feb 26 '20 at 15:16
  • ***"the error gets spat out immediately"***: So it's not `tkinter` related, edit your `title`. Yes, either your connection or the used endpoint. Relevant: [`"unexpected keyword argument 'strict'"`](https://stackoverflow.com/search?q=%22unexpected+keyword+argument+%27strict%27%22) – stovfl Feb 26 '20 at 15:22
  • Edited Title as suggested, but if its spat out immediate, it would not be a connection? As it seems or timing suggests its not even attempting any connection. – Alehandro Feb 26 '20 at 15:24
  • Looking at other libs/api's turns out stashy is depreciated? Please correct me if I am wrong. Gathered from other research/looking at best method/practice to get into bit bucket. Looking at atlassian-python-api instead, will report back. Please let me know if this is the right approach. – Alehandro Feb 27 '20 at 21:27
  • The same error occurs regardless of using curl --> Python and use python requests get dropped before even attempting. – Alehandro Feb 28 '20 at 18:15
  • Okay I think the reason for my issue is request, lib is out of date using version 1.1 while everyone else has version 2. something. I will attempt to update this lib, and post back the answer (If this fixes my problem) – Alehandro Mar 03 '20 at 19:03

1 Answers1

0

Upgraded all libs, did not use stashy, used requests and worked fine. If you are using requests library and getting the same error, also upgrade requests. Make sure you are using the latest versions of libs, or you will get the same error and be stuck. Was stuck on this for a few days, as everyone kept telling me to look @ the error, but the error did not provide anything meaningful to give me any hints. I seem to have been very very confused, but upgrading the libraries again fixed my issues, only wish we had more verbose error logging for version controls of libraries.

Alehandro
  • 39
  • 8