Skip to content

project.wikis.create with subpages results in 404 Wiki Page Not Found #1079

Closed
@kernelport

Description

@kernelport

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/subtitle

But 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%2Fsubtitle

How can I handle this URL Encoding for slug in python-gitlab correct?

Expected Behavior

Actual Behavior

Specifications

  • python-gitlab version: 2.0.1
  • API version you are using (v3/v4): V4
  • Gitlab server version (or gitlab.com): '12.8.1', 'd18b43a5f5a'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions