python / python/cpython

Some ntpath/posixpath functions unusable on foreign OS

オープン
#119,671 コメント 9 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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.path module 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:

  • posixpath for UNIX-style paths
  • ntpath for 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:

  • basename
  • commonpath
  • commonprefix
  • dirname
  • isabs
  • join
  • normcase
  • normpath
  • split
  • splitdrive
  • splitroot
  • splitext

These functions are probably unsafe because they rely on details of the host OS (e.g. via the os module):

  • abspath
  • exists
  • lexists
  • expanduser
  • expandvars
  • getatime
  • getmtime
  • getctime
  • getsize
  • isfile
  • isdir
  • isjunction
  • islink
  • ismount
  • isdevdrive
  • realpath
  • relpath
  • samefile
  • sameopenfile
  • samestat
  • supports_unicode_filenames
Linked PRs
  • gh-119772

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue にリンクされている os.path のドキュメントの概要から始め、字句的な関数とホスト依存の関数の一覧を確認してください。変更を加える前に、リンクされている PR gh-119772 を確認してください。ntpath と posixpath のどの関数が異なる OS 上でも安全で、どの関数がホスト OS に依存するのかをドキュメントで明確に説明できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。