Skip to content

Get asset links issue if tag_name have "/" char #2116

Closed
@thcao-ampere

Description

@thcao-ampere

Description of the problem, including code/CLI snippet

releases = project.releases.list()
for rel in releases:
    links = rel.links.list()

https://github.com/python-gitlab/python-gitlab/blob/main/gitlab/v4/objects/releases.py#L43

_path = "/projects/{project_id}/releases/{tag_name}/assets/links"

If tag_name = "abc/xyz" --> _path = "/projects/{project_id}/releases/abc/xyz/assets/links"
We should replace "/" to "%2F" in tag_name, _path = "/projects/{project_id}/releases/abc%2Fxyz/assets/links"

Expected Behavior

Get asset link list from release

Actual Behavior

Get exception GitlabListError: 404: 404 Not Found

Specifications

  • python-gitlab version: all version
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): gitlab.com

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