AttributeError: type object Signature has no attribute _encoding
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ả
Hi folks!
I'm running into this weird error when running my python code with ray.
Basically I get AttributeError: type object 'Signature' has no attribute '_encoding'.
But it works fine when I run my script without ray...
pygit2 version: v1.12.2
environment: python:3.9.16 docker container.
The error can be reproduced with the code below.
Ray can be installed from PyPi: pip install ray
import pygit2
import ray
from pygit2 import Signature
def function_without_ray():
org_name = "libgit2"
repo_name = "pygit2"
repo = pygit2.clone_repository(
f"https://github.com/{org_name}/{repo_name}",
f"/tmp/{repo_name}.git",
)
new_branch = repo.branches.create(
"dummy-branch", repo.revparse_single("HEAD")
)
repo.checkout(new_branch)
index = repo.index
index.add_all()
index.write()
author = Signature("John Doe", "john@doe.com")
ref = repo.head.name
tree = index.write_tree()
parents = [repo.head.target]
repo.create_commit(
ref,
author,
author,
"Just a dummy commit",
tree,
parents,
)
@ray.remote
def function_with_ray():
function_without_ray()
# Comment out one of these function calls to check if it works:
ray.get(function_with_ray.remote())
function_without_ray()
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện được cung cấp trong môi trường Docker với Python 3.9.16, pygit2 v1.12.2 và Ray được cài đặt từ PyPI, đồng thời so sánh quá trình thực thi khi có và không có Ray. Truy vết thời điểm Signature mất _encoding và xác định một regression test tập trung; được xem là hoàn tất khi trường hợp Ray được tái hiện không còn phát sinh AttributeError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 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
- 42/100