Repository navigation
project.wikis.create with subpages results in 404 Wiki Page Not Found #1079
Copy link
Copy link
Closed
Description
Activity
- added a commit that references this issue
on Apr 22, 2020 @kernelport I think I can replicate your url encoding fix as well.
this works:
page = wiki.project.wikis.get('my/path/to/asdasd') >>> page.save() >>> page.slug 'my/path/to/asdasd' >>> page.slug = 'my%2Fpath%2Fto%2Fasdasd' >>> page.save() >>>
but this will 404 error:
>>> page.slug = 'my%2Fpath%2Fto/asdasd' >>> page.save() Traceback (most recent call last): File "/Library/Python/3.8/site-packages/gitlab/exceptions.py", line 304, in wrapped_f return f(*args, **kwargs) File "/Library/Python/3.8/site-packages/gitlab/mixins.py", line 417, in update result = http_method(path, post_data=new_data, files=files, **kwargs) File "/Library/Python/3.8/site-packages/gitlab/client.py", line 807, in http_put result = self.http_request( File "/Library/Python/3.8/site-packages/gitlab/client.py", line 628, in http_request raise gitlab.exceptions.GitlabHttpError( gitlab.exceptions.GitlabHttpError: 404: 404 Not Found The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/3.8/site-packages/gitlab/mixins.py", line 552, in save server_data = self.manager.update(obj_id, updated_data, **kwargs) File "/Library/Python/3.8/site-packages/gitlab/exceptions.py", line 306, in wrapped_f raise error(e.error_message, e.response_code, e.response_body) from e gitlab.exceptions.GitlabUpdateError: 404: 404 Not Found >>>
- added 14 commits that reference this issue
on Jan 9, 2022 - locked as resolved and limited conversation to collaborators
on Jan 16, 2023
Metadata
Metadata
Assignees
Labels
No labels
Description of the problem, including code/CLI snippet
page = project.wikis.create({'title': "title/subtitle", 'content': "test content"})
does create a wiki subtitle in the directory title well.
If I try to edit this page with:
page.content = "update content"
page.title = "subtitle" # Attention: during update the page we have to set the title without the directory name
page.save()
I get gitlab.exceptions.GitlabUpdateError: 404: 404 Wiki Page Not Found
I can reproduce this by using curl:
curl --request PUT --data "content=update content" --header "PRIVATE-TOKEN: XXX" https://gitlab.kernelport.com/api/v4/projects/231/wikis/title/subtitleBut when I encode the slug URL it does work with curl.
curl --request PUT --data "content=update content" --header "PRIVATE-TOKEN: XXX" https://gitlab.kernelport.com/api/v4/projects/231/wikis/title%2FsubtitleHow can I handle this URL Encoding for slug in python-gitlab correct?
Expected Behavior
Actual Behavior
Specifications