You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem, including code/CLI snippet
I'm trying to delete all labels from a given project using this code:
# connect to Gitlabgl=gitlab.Gitlab(GITLAB_URL, private_token=GITLAB_TOKEN)
gl.auth()
# Get GitLab projectgl_project=gl.projects.get(GITLAB_PROJECT_ID)
# delete ALL labelsforgl_labelingl_project.labels.list(all=True):
gl_label.delete()
The token works since I've used it successfully to do some other API calls before. The same user is able to delete labels manually via Web-UI.
Expected Behavior
I would expect the code not to throw a `gitlab.exceptions.GitlabDeleteError: 404: 404 Label Not Found'
Actual Behavior
The delete call fails with a gitlab.exceptions.GitlabDeleteError: 404: 404 Label Not Found.
Specifications
python-gitlab version: 3.1.1
API version you are using (v3/v4): v4
Gitlab server version (or gitlab.com): GitLab Enterprise Edition 14.5.0-ee
But also we probably have multiple encoding happening.
Python 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse
>>> a ="comp%253AFlat%2520Export"
>>> urllib.parse.unquote(a)
'comp%3AFlat%20Export'
>>> b = urllib.parse.unquote(a)
>>> urllib.parse.unquote(b)
'comp:Flat Export'
>>>
Activity
nejch commentedon Feb 1, 2022
Thanks @just-doit for the report, could you maybe add
gl.enable_debug()and show the output here, just redact the token if it appears anywhere.just-doit commentedon Feb 1, 2022
Hi,
this is the complete output:
JohnVillalovos commentedon Feb 1, 2022
Seems like this is wrong:
Probably should be:
But also we probably have multiple encoding happening.
JohnVillalovos commentedon Feb 1, 2022
@just-doit Any chance you can print the value of the label that you are trying to delete?
just-doit commentedon Feb 1, 2022
It's
comp:Flat Export.fix: remove custom `delete` method for labels
fix: remove custom `delete` method for labels
fix: remove custom `delete` method for labels
JohnVillalovos commentedon Feb 1, 2022
I have proposed a fix here: #1868
fix: remove custom `delete` method for labels
just-doit commentedon Feb 1, 2022
Wow this was fast. 👍