Some ntpath/posixpath functions unusable on foreign OS
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ả
The os.path docs intro includes:
Note: Since different operating systems have different path name conventions, there are several versions of this module in the standard library. The
os.pathmodule is always the path module suitable for the operating system Python is running on, and therefore usable for local paths. However, you can also import and use the individual modules if you want to manipulate a path that is always in one of the different formats. They all have the same interface:
posixpathfor UNIX-style pathsntpathfor Windows paths
But we don't explain that some of the functions in ntpath and posixpath aren't suitable for usage on a "foreign" OS, e.g. that using ntpath.realpath() from POSIX is a bad idea.
These functions are safe because they do purely lexical work:
basenamecommonpathcommonprefixdirnameisabsjoinnormcasenormpathsplitsplitdrivesplitrootsplitext
These functions are probably unsafe because they rely on details of the host OS (e.g. via the os module):
abspathexistslexistsexpanduserexpandvarsgetatimegetmtimegetctimegetsizeisfileisdirisjunctionislinkismountisdevdriverealpathrelpathsamefilesameopenfilesamestatsupports_unicode_filenames
Linked PRs
- gh-119772
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 với phần giới thiệu tài liệu về os.path được liên kết trong issue và xem lại các danh sách hàm mang tính từ vựng và phụ thuộc vào host. Kiểm tra PR gh-119772 được liên kết trước khi thực hiện thay đổi. Hoàn thành khi tài liệu giải thích rõ những hàm nào của ntpath và posixpath an toàn trên một OS khác, và những hàm nào phụ thuộc vào OS host.
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
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 20/100