How can `sep` parameter be used? Is it broken?
まだ誰も着手していません。
評価
調査の方向性
glob2/impl.py の 211-215 行付近から始め、sep='/' を指定した Windows 上の custom-globber のケースを再現します。_join_paths と os.path.join が区切り文字をどのように扱うかを追跡し、そのうえで、issue で指摘されている疑わしいバックスラッシュも含め、sep に期待される動作を定義してテストします。
索引モデルが issue の本文から書いたものです。
説明
I'm using a custom globber that internally uses only forward slashes and I also consistently specify sep='/' to iglob etc., and yet, on Windows I can still get paths joined by '\'.
I see that this sep is only being passed to _join_paths, and inside it all that happens is that / gets replaced with this character. What about replacing \, though?
There's also a suspicious backslash (that has no effect at all) inside the pattern 🤔
It's strange that os.path.join is being used for this library, which strives to fully abstract this operation -- and currently seems like I have no better option but to map all its outputs through pathlib.Path(p).to_posix(). This particular operation is not overridable.
So, my use case doesn't work, but I also find it difficult to understand how sep can be used at all, as on Windows it will always just be skipped.
- 主要言語
- Python
- スター
- 125
- フォーク
- 20
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
miracle2k/python-glob2 のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
miracle2k/python-glob2#25 · コメント 1 件 · リアクション 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
miracle2k/python-glob2#30 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
miracle2k/python-glob2#29 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
miracle2k/python-glob2#28 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
miracle2k/python-glob2#21 · コメント 4 件 · リアクション 3 件 ·
miracle2k/python-glob2 の issue をすべて見る
似ている issue
-
customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/azure-cli#34150 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
community-request
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
NVIDIA-NeMo/Curator#2464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
WeblateOrg/translation-finder#1099 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7997 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信