python / python/cpython

Use NETRC environment variable

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

@picnixz đang làm issue này rồi.

Từ ngày 16/8/2025.

stdlib type-feature
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ả

Feature or enhancement

Proposal:

Hi,

I'd like to add support to the NETRC environment variable as documented in GNU inetuils v2.6 (https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html). Other tools and libraries are already supporting that envvar and I think it would be nice to aligned as well in that regard.

Supporting the envvar should be as simple as changing:

https://github.com/python/cpython/blob/7c4361564c3881946a5eca677607b4ffec0a566d/Lib/netrc.py#L70

with

file = os.environ.get("NETRC", None) or os.path.join(os.path.expanduser("~"), ".netrc")

Best regards,
Berthin

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs
  • gh-135802

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.

Đánh giá

Issue này chưa được đánh giá.

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.