Document that the built-in open() when called with a file descriptor ignores "mode" argument

Đang mở
#95,498 2 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ó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
50/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
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu từ tài liệu được liên kết của hàm tích hợp sẵn open() và kiểm tra phần mô tả đối số mode. Kiểm tra mục os.fdopen() được liên kết để xác nhận ngữ cảnh bí danh, sau đó ghi lại rằng mode bị bỏ qua khi open() nhận một bộ mô tả tệp; tài liệu của open() và os.fdopen() cần truyền đạt rõ ràng hành vi này.

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

Mô tả

docs topic-IO

At https://docs.python.org/3/library/functions.html#open, in the documentation of the mode argument there is no information that this argument is ignored when the function is called with a file descriptor instead of a path.

See Why does os.fdopen ignore mode? SO question. The question talks about os.fdopen() but according to https://docs.python.org/3/library/os.html#os.fdopen

This is an alias of the open() built-in function and accepts the same arguments.

so I think it should be enough to place the information in the documentation of the mode argument of the built-in open() function. This way it would document the built-in open() function but also the os.fdopen() function by virtue of the latter being an alias of the former.

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.