Skip to content

Object deletion from lazy get #1494

Closed
Closed

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"

Activity

  1. changed the title [-]Object deletion with from lazy get[/-] [+]Object deletion from lazy get[/+] on Jun 3, 2021
  2. nejch commented on Jun 3, 2021

    @nejch
    Member

    Related to #1356

  3. nejch commented on Jan 13, 2022

    @nejch
    Member
  4. locked as resolved and limited conversation to collaborators on Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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