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

Abierto Apto para principiantes
#4,925 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Deepjyoti-Sarmah ya está trabajando en esto.

Desde el 1/11/2026.

  • #4937 de @Deepjyoti-Sarmah — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
tooling

Línea de trabajo

Empieza en graphify/cache.py en file_hash y _normalize_path. El resultado en minúsculas de os.path.normcase debe seguir siendo solo la clave de caché, mientras que is_file(), la ruta rápida de stat y la lectura usan la ruta original. El commit e73b6060 (#629) introdujo _normalize_path, así que primero verifica su intención. Está terminado cuando file_hash abre la escritura original y las claves de caché se mantienen estables, lo que un test que simula normcase puede demostrar sin WSL.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Python
Estrellas
124k
Forks
11.9k
Merge medio
2 h 35 min
PR fusionados (30 d)
6

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Graphify-Labs/graphify

Todos los issues de Graphify-Labs/graphify

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.