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

Bitbucket - get_content_of_file() does not handle filename with spaces in it. #1485

Open
san-gitlogin opened this issue Jan 4, 2025 · 0 comments

Comments

@san-gitlogin
Copy link

For example, if the file path passed as an argument to the "get_content_of_file()" is - "something/child/ABCD123R #7 --- for Some testing.txt", the stack trace is as follows:

File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/atlassian/bitbucket/__init__.py", line 2625, in get_content_of_file return self.get(url, params=params, not_json_response=True, headers=headers) │ │ │ │ └ {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Atlassian-Token': 'no-check'} │ │ │ └ {} │ │ └ 'rest/api/1.0/projects/EPFILE/repos/iar_kit/raw/something/child/ABCD123R #07 --- for Some testing.txt' │ └ <function AtlassianRestAPI.get at 0x102742340> └ <atlassian.bitbucket.Bitbucket object at 0x102a597f0> File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/atlassian/rest_client.py", line 341, in get response = self.request( │ └ <function AtlassianRestAPI.request at 0x1027422a0> └ <atlassian.bitbucket.Bitbucket object at 0x102a597f0> File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/atlassian/rest_client.py", line 313, in request self.raise_for_status(response) │ │ └ <Response [404]> │ └ <function AtlassianRestAPI.raise_for_status at 0x102742700> └ <atlassian.bitbucket.Bitbucket object at 0x102a597f0> File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/atlassian/rest_client.py", line 580, in raise_for_status raise HTTPError(error_msg, response=response) │ │ └ <Response [404]> │ └ 'The path "something/child/ABCD123R " does not exist at revision "refs/heads/master"' └ <class 'requests.exceptions.HTTPError'>

Notice the path is taken incorrectly as "something/child/ABCD123R " excluding the data after the space, instead of considering the complete path "something/child/ABCD123R #7 --- for Some testing.txt"

I cross-checked that the file does exist in the provided path.

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