Skip to content

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

Closed

Description

@AndresDiagoM

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 e73b606 (#629, UNC and extended-length paths in the semantic cache).

Activity

  1. github-actions commented on Nov 1, 2026

    @github-actions

    Thanks for opening this issue, @AndresDiagoM. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. safishamsi commented on Nov 2, 2026

    @safishamsi
    Member

    Fixed in 0.9.101 (published to PyPI) via #4937. Cache keys keep their written case and hashed/word-count files are opened through os_long_path, so a normcase-folded path no longer raises IsADirectoryError and README.md/readme.md no longer collide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions