Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

CloudPickle returns IndexError when trying to pickle _UnPicklable object

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu trong cloudpickle/cloudpickle_fast.py tại dòng 634 và chạy reproducer BytesIO của issue với _Unpicklable. Theo dõi việc xử lý ngoại lệ khi getstate gây ra NotImplementedError. Hoàn tất khi reproducer không còn tạo ra IndexError đã được báo cáo và lỗi ban đầu được xử lý nhất quán.

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

Mô tả

The error happens at https://github.com/cloudpipe/cloudpickle/blob/a76f0812ccdbbd1397f36d536dc4d57b6d0557d6/cloudpickle/cloudpickle_fast.py#L634.

When I try to pickle the below class, it is failing with NotImplementedError then it calls the exception, since NotImplemented error is a subclass of RuntimeError, the above code fails during except since e.args is empty.

with io.BytesIO() as file:
  pickler = cloudpickle.CloudPickler(file)
  pickler.dump(_Unpicklable(1))

class _Unpicklable(object):
  def __init__(self, value):
    self.value = value

  def __eq__(self, other):
    return self.value == other.value

  def __getstate__(self):
    raise NotImplementedError()

  def __setstate__(self, state):
    raise NotImplementedError()
Ngôn ngữ chính
Python
Star
1.9k
Fork
197
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
1

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Issue khác của cloudpipe/cloudpickle

Tất cả issue của cloudpipe/cloudpickle

Issue tương tự

Thêm issue về Python

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.