libgit2 / libgit2/pygit2

pygit2.GitError: failed to parse supported auth schemes: The operation identifier is not valid.

Đang mở
#1,225 4 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
1.7k
Fork
408
Merge trung bình
2 ngày 57 phút
Pull request đã merge (30 ngày)
7

Mô tả

I am trying to clone private github repository using pygit2 module but getting the below error.

Traceback (most recent call last):
  File ".\test2.py", line 29, in <module>
    repoClone = pygit2.clone_repository(repo_from_template.clone_url, 'C://TestRepo', callbacks=callbacks)
  File "C:\Anaconda3\lib\site-packages\pygit2\__init__.py", line 222, in clone_repository
    payload.check_error(err)
  File "C:\Anaconda3\lib\site-packages\pygit2\callbacks.py", line 93, in check_error
    check_error(error_code)
  File "C:\Anaconda3\lib\site-packages\pygit2\errors.py", line 65, in check_error
    raise GitError(message)
_pygit2.GitError: failed to parse supported auth schemes: The operation identifier is not valid.

Below is the source code I am using

import pygit2
import config_
from github import Github

g = Github(<personal access token>,base_url='https://api.github.com')
github_user = g.get_user()
org = g.get_organization(<org-name>)

repo_from_template=org.create_repo(name='TestRepo',private=True)

credentials = pygit2.UserPass(github_user.login, <personal access token>)
callbacks = pygit2.RemoteCallbacks(credentials=credentials)
repoClone = pygit2.clone_repository(repo_from_template.clone_url, 'C://TestRepo', callbacks=callbacks)

I am using python 3.9 and have tried pygit2 version 1.10.1 and 1.12.0 and both are giving the same error.
Are there any changes made to the callbacks recently which is creating this issue?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện lỗi từ lời gọi clone_repository của issue bằng cách sử dụng RemoteCallbacks với thông tin xác thực UserPass đối với một kho lưu trữ GitHub riêng tư trên Python 3.9, kiểm thử pygit2 1.10.1 và 1.12.0. Theo dõi đường dẫn callback và xác thực được nêu trong traceback; hoàn tất khi đã xác định được nguyên nhân và việc clone riêng tư thành công, hoặc khi sự không tương thích được ghi chép rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, github, python
Lĩnh vực
authentication, devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.