Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bad URL construction when querying commits containing path parameters #3229

Closed
@tiborballa

Description

@tiborballa

Description of the problem, including code/CLI snippet

When using thepath parameter in aproject.commits.list query, an incorrect URL is constructed.

import gitlabimport logginglogging.basicConfig(level=logging.DEBUG)GITLAB_TOKEN = ''GITLAB_URL = 'https://gitlab.example.com'  # Fake urlPROJECT_ID = '7813'   TARGET_PATH = 'test_folder'         def list_commits_for_path(gl, project_id, path):    project = gl.projects.get(project_id)    new_commits = project.commits.list(path=path)    return new_commitsif __name__ == "__main__":    gl = gitlab.Gitlab(GITLAB_URL, private_token=GITLAB_TOKEN, ssl_verify=False)    commits = list_commits_for_path(gl, PROJECT_ID, TARGET_PATH)    for commit in commits:        print(f"- {commit.id[:8]} | {commit.author_name} | {commit.created_at} | {commit.title}")

Expected Behavior

The correct URL should look like this:
https://gitlab.example.com/api/v4/projects/7813/repository/commits?path=test_folder

Actual Behavior

Debug level log message:

DEBUG:urllib3.connectionpool:https://gitlab.example.com:443 "GET /api/v4test_folder HTTP/1.1" 404 37

Based on the log, it seems the URL might be the following:

https://gitlab.example.com/api/v4test_folder

Specifications

  • python-gitlab version: 6.1.0
  • Gitlab server version (or gitlab.com): GitLab Enterprise Edition - v17.5.5-ee

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp