python / python/cpython

`zipfile`: docs should document what `ZipInfo.date_time` actually is

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

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

3.13 3.14 docs stdlib
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Documentation

Currently, the documentation for ZipInfo.date_time is:

The time and date of the last modification to the archive member. This is a tuple of six values:
...
Note: The ZIP file format does not support timestamps before 1980.

This should be extended/clarified to define which date/time is meant (which currently is only hinted by the does not support timestamps before 1980.

The ZIP format supports for multiple timestamps:

  • there's the last mod file time and last mod file date in the central directory (see chapters 4.3.7 and 4.4.6)
  • but also various times (e.g. for NTFS and UNIX) as part of the extra fields (see e.g. chapter 4.5.7).

The latter may e.g. support times before 1980, higher resolutions and time zones.

Right now it seems not strictly defined what .date_time actually returns - from what I can see from the code, it's the one from the central directory - but that could in principle be just an implementation detail and a future version of zipfile could e.g. use the extra fields if present.

Thus it would be nice, if the documentation could specify, whether .date_time is always meant to be the time from the central directory, or whether this could change.

Thanks,
Chris.

Linked PRs
  • gh-136082
  • gh-138076
  • gh-138077

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

Bắt đầu với tài liệu zipfile.ZipInfo.date_time được liên kết và kiểm tra triển khai zipfile hiện có cung cấp thuộc tính này. Cập nhật tài liệu để nêu rõ nó biểu thị timestamp ZIP nào và liên quan như thế nào đến các trường timestamp khác, sau đó kiểm tra phần văn bản được kết xuất và các bước kiểm tra tài liệu.

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
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
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
25/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.