`file_hash` opens the lowercased path on Windows, so files with uppercase names fail on case-sensitive dirs (`\wsl.localhost`)

オープン 初心者向け
#4,925 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Deepjyoti-Sarmah がすでに取り組んでいます。

2026年11月1日 から。

  • #4926 @AndresDiagoM による — オープン
  • #4937 @Deepjyoti-Sarmah による — オープン

評価

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

調査の方向性

graphify/cache.py の file_hash と _normalize_path から始めてください。os.path.normcase の小文字化された結果はキャッシュキーとしてのみ使い、is_file()、stat による高速パス、読み取りには元のパスを使う必要があります。コミット e73b6060 (#629) で _normalize_path が導入されたので、まずその意図を確認してください。file_hash が元の表記のパスを開き、キャッシュキーが安定していれば完了です。これは WSL を使わずに、normcase をモックするテストで示せます。

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

説明

What happened?

On Windows, file_hash (graphify/cache.py) normalizes the path with _normalize_path, which calls os.path.normcase and so lowercases it, and then uses that lowercased path for the file itself: p.is_file(), the stat fastpath and the read. On a case-sensitive directory, a file with uppercase letters in its name is then "not a file", and the rebuild fails.

I hit it on the WSL share (\\wsl.localhost\<distro>\...), which is case-sensitive. README.md becomes ...\readme.md, which does not exist there:

warning: worker failed for \\wsl.localhost\Ubuntu\home\<user>\repro\README.md: file_hash requires a file, got: \\wsl.localhost\ubuntu\home\<user>\repro\readme.md
[graphify watch] Rebuild failed: file_hash requires a file, got: \\wsl.localhost\ubuntu\home\<user>\repro\readme.md
Nothing to update or rebuild failed — check output above.

graphify update exits 1.

The lowercasing makes sense for the cache key (stable keys across Windows path spellings, #629), but it should not be the path used to open the file.

Steps to reproduce
  1. On Windows with WSL, a repo inside the distro with any file with an uppercase letter (here README.md plus 40 .py files).
  2. From PowerShell, cd \\wsl.localhost\Ubuntu\home\<user>\repro and run graphify update . --force.

Today this step hangs first because of #4924; with that fix applied, it fails as above in about 10 s.

Graphify version

v8 at 0.9.100, plus the #4924 fix so the run gets past the lock.

Operating System

Windows 11 Pro (Insider build 26340), WSL 3.0.3, Ubuntu distro.

Python Version

3.11

Additional context

_normalize_path came in with e73b6060 (#629, UNC and extended-length paths in the semantic cache).

主要言語
Python
スター
124k
フォーク
11.9k
平均マージ
2時間 35分
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

Graphify-Labs/graphify のほかの issue

Graphify-Labs/graphify の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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