Unify interpretation of values of environment variables and CLI options
Chưa có ai nhận issue này.
- 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ả
There is inconsistency in interpreting values of different environment variables that have equivalent of CLI options.
- For some environment variables, defining them with any values (even empty) is interpreted as true.
- For some environment variables, any values except 0 (including non-numbers and empty value) are interpreted as true. Only 0 is interpreted as false. For some of these variables it makes sense to set integer value > 1, but for other they are just booleans.
- PYTHONUTF8 and PYTHON_GIL only accept "1" and "0". All other values are errors. Although the code for these two variables is very different.
- PYTHON_FROZEN_MODULES only accepts "on" and "off". All other values are errors.
- PYTHONCOERCECLOCALE has three state: "0", "warn" and... anything other.
- Some environment variables has "0" as a special value, but PYTHON_CPU_COUNT uses "default".
There are similar things for corresponding CLI options which accept optional arguments.
Such diversity makes it difficult to document and use environment variables and CLI options. It can lead to subtle bugs if "0" is interpreted differently. An empty value of the environment variable can be the result of a hidden bug, but in most cases it is currently silently accepted and interpreted as true value.
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 lập danh mục các biến môi trường và các tùy chọn CLI tương đương được mô tả trong issue, đồng thời so sánh cách xử lý hiện tại của chúng đối với các giá trị rỗng, số, boolean và không hợp lệ. Cần thống nhất chính sách diễn giải trước khi triển khai. Được xem là hoàn tất khi các biến môi trường được liệt kê và các tùy chọn CLI tương ứng tuân theo các quy tắc nhất quán, bao gồm cả cách xử lý nhất quán đối với các giá trị không hợp lệ.
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
- cli
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100