Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bearer token on Linux environment has new line character #1337

Open
ashishpatel1992 opened this issue Feb 23, 2024 · 0 comments
Open

Bearer token on Linux environment has new line character #1337

ashishpatel1992 opened this issue Feb 23, 2024 · 0 comments

Comments

@ashishpatel1992
Copy link
Contributor

Environment

Oracle Linux 8.6
Python 3.9.13
pip 23.1.2
atlassian-python-api 3.39.0

It appears that \n is getting appended when generating bearer token

Traceback (most recent call last):
  File "/tmp/aaspatel_test/confluence_uploader.py", line 48, in <module>
    new_page=create_page_under_parent(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/utils/operations.py", line 55, in create_page_under_parent
    space_key = confluence_instance.get_page_space(parent_id)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/atlassian/confluence.py", line 258, in get_page_space
    return ((self.get_page_by_id(page_id, expand="space") or {}).get("space") or {}).get("key") or None
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/atlassian/confluence.py", line 346, in get_page_by_id
    response = self.get(url, params=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/atlassian/rest_client.py", line 288, in get
    response = self.request(
               ^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/atlassian/rest_client.py", line 241, in request
    response = self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/urllib3/connection.py", line 399, in request
    self.putheader(header, value)
  File "/tmp/aaspatel_test/venv/lib/python3.11/site-packages/urllib3/connection.py", line 313, in putheader
    super().putheader(header, *values)
  File "/home/opc/.pyenv/versions/3.11.4/lib/python3.11/http/client.py", line 1264, in putheader
    raise ValueError('Invalid header value %r' % (values[i],))
ValueError: Invalid header value b'Bearer OTQ5Nzc3MjIxNzM2OsGGJBpfw6U16GLuiItcQu9W+AU6\n'
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant