Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

How can `sep` parameter be used? Is it broken?

オープン
#26 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

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?

https://github.com/miracle2k/python-glob2/blob/ef4b58f0d2a6eb0197446ab4b047cc45e4c60500/glob2/impl.py#L211-L215

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

miracle2k/python-glob2 のほかの issue

miracle2k/python-glob2 の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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