Skip to content

Object deletion from lazy get #1494

@vbisserie

Description

@vbisserie

Description of the problem, including code/CLI snippet

Lazy objects with name containing http encoded character (like "/") can not be deleted.

Expected Behavior

p = gitlab.projects.get(1)
b = p.branches.get("foo/bar", lazy=True)  # The name shall contain http encoded char like "/"
b.delete()

Branch shall be deleted

Actual Behavior

b.delete() will raise an exception 404

Specifications

  • python-gitlab version: v2.7.1
  • API version you are using (v3/v4): v4

Suggestion

https://github.com/python-gitlab/python-gitlab/blob/master/gitlab/utils.py#L60
clean_str_id seems to be called on an already encoded name.
"foo/bar" -> "foo%2Fbar" -> "foo%252Fbar"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions