Documentation is self-contradictory regarding Windows-supported file permissions

Đang mở
#101,675 2 bình luận 1 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
25/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python

Hướng nghiên cứu

Trước tiên, hãy kiểm tra trạng thái của PR được liên kết gh-101694. So sánh các mô tả về quyền Windows trong tài liệu của os.chmod và stat với các chú thích liên quan trong Lib/stat.py; công việc được xem là hoàn tất khi thuật ngữ nhất quán ở cả ba vị trí.

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

Mô tả

docs OS-windows

Documentation

One the one hand, the os.chmod documentation says that Windows only supports stat.S_IWRITE and stat.S_IREAD.

But on the other hand, the stat module documentation says that both of those (S_IWRITE and S_IREAD) are Unix V7 synonyms for S_IWUSR and S_IRUSR (and in fact comments in the stat code say the same thing).

That's confusing. One piece of documentation says Windows supports them (in fact, only them) and another piece of documentation says they're for Unix (i.e. not Windows).

The naming "IWUSR" and "IRUSR" implies the typical Unix permission model, which does not apply on Windows, so it makes sense that Windows code should ideally not use S_IWUSR or S_IRUSR (even though the code would happen to work because the values are identical to S_IWRITE and S_IREAD).

Therefore, I think the fix should be to replace the "Unix V7 synonym for ..." statements with "Unix V7 synonym for ..., also used on Windows" in both of the following:

  • comments in the stat module code
  • statements in the stat documentation
Linked PRs
  • gh-101694
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
558

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.

Issue khác của python/cpython

Tất cả issue của python/cpython

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.