Difference in _use_fd_functions in shutil.py and test_shutil.py
オープン
まだ誰も着手していません。
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
When switching from os.listdir to os.scandir 7 years ago somebody forgot to update the definition of _use_fd_functions in test_shutil together with shutil module.
in shutil:
_use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
os.supports_dir_fd and
os.scandir in os.supports_fd and
os.stat in os.supports_follow_symlinks)
in test_shutil:
_use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
os.supports_dir_fd and
os.listdir in os.supports_fd and
os.stat in os.supports_follow_symlinks)
I believe there is no need to calculate this variable twice so I'm gonna propose a PR where I use the value from shutil.py in its tests. Nobody will ever forget to update both places again.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず shutil.py と test_shutil.py の _use_fd_functions の定義を比較し、次にテスト側の値がどのように使用されているかを調べます。現在の動作を確認するために shutil のテストを実行し、テストがカバレッジやプラットフォーム固有の動作を変更せずにモジュールの単一の値を使用していることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- testing-qa
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100