python / python/cpython

`/a/**` is understood by `Path.full_match` as `/a` followed by multiple segments, at least one

オープン
#139,580 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

Bug report

Bug description:

/a/** is understood by Path.full_match as "/a followed by multiple segments, at least one", instead of "/a followed by multiple segments, including zero".

From https://docs.python.org/3/library/pathlib.html#pathlib-pattern-language

** (entire segment)
Matches any number of file or directory segments, including zero.
# one segment per **
Path('/a/b').full_match('/a/**') # True
# zero segments per **
Path('/a').full_match('/a/**') # False - expected True
# interestingly
Path('/').full_match('/**') # True
CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs
  • gh-151479

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

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

はじめの一歩

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

調査の方向性

pathlib Path.full_match エントリポイントから始め、** について文書化されたパターン言語とその動作を比較します。/a/** と /** の例を再現し、続いて ** がゼロ個のセグメントにマッチすることを示す回帰テストのカバレッジを追加します。リンクされた PR gh-151479 は、すでに作業が進行中であることを示しています。

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

評価

技術スタック
python
領域
operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

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

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