Skip to content

Api return 404 when keyword contains point symbol #1715

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

Closed
insoz opened this issue Nov 26, 2021 · 9 comments · Fixed by #1800
Closed

Api return 404 when keyword contains point symbol #1715

insoz opened this issue Nov 26, 2021 · 9 comments · Fixed by #1800
Assignees

Comments

@insoz
Copy link

insoz commented Nov 26, 2021

if the branch/commit keyword contains point symbol . , the api will return 404 response

example:
project.branches.get('stbale-1.x')
project.comits.get('stbale-1.x')


In page: gl_objects/projects.rst

@JohnVillalovos
Copy link
Member

Can you run the following and provide the output?

#!/usr/bin/env python3

import gitlab
print("gitlab version:", gitlab.__version__)
print("gitlab location:", gitlab.__file__)

@JohnVillalovos
Copy link
Member

As a note, to help your debugging you can do the following, if you want:

import gitlab

gl = gitlab.Gitlab(... your values ...)
gl.enable_debug()

@insoz
Copy link
Author

insoz commented Nov 26, 2021

version: '2.10.1'
file: '/Users/insoz/code/ops-fast/venv/lib/python3.7/site-packages/gitlab/init.py'

@JohnVillalovos
Copy link
Member

Thanks. I have a suspicion it is because of:

new_path = parsed.path.replace(".", "%2E")

But not sure if we can just take that out or not. We really need to move to using urllib.parse.quote() for this stuff. Though requests does some it self and I haven't dug into exactly what we are responsible for and what requests will take care of.

@JohnVillalovos
Copy link
Member

Related issue: #1356

@insoz
Copy link
Author

insoz commented Nov 26, 2021

Thanks! BTW. Do we have some plan to use httpx or something asyncio tool to asynchronous this lib ?

@nejch
Copy link
Member

nejch commented Nov 26, 2021

Thanks! BTW. Do we have some plan to use httpx or something asyncio tool to asynchronous this lib ?

Yes, httpx probably, though it still hasn't reached 1.0 and last I checked was missing some proxy or retry features or so, if I'm not mistaken, can't quite remember.
But there is an old PR here that already uses it if you really need it (likely missing lots of recent features): #1036. That'll need some major rework to update though once we're ready.

@nejch
Copy link
Member

nejch commented Jan 4, 2022

@JohnVillalovos wasn't this fixed by 702e41d? If so we can close it, unless you'd like to add a test for that.

JohnVillalovos added a commit that referenced this issue Jan 4, 2022
Add a test case to show that a branch name with a period can be
fetched with a `get()`

Closes: #1715
JohnVillalovos added a commit that referenced this issue Jan 4, 2022
Add a test case to show that a branch name with a period can be
fetched with a `get()`

Closes: #1715
JohnVillalovos added a commit that referenced this issue Jan 4, 2022
Add a test case to show that a branch name with a period can be
fetched with a `get()`

Closes: #1715
@JohnVillalovos
Copy link
Member

@JohnVillalovos wasn't this fixed by 702e41d? If so we can close it, unless you'd like to add a test for that.

It was. I just added PR #1800 to prove it works

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants