Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on Windows

Abierto Apto para principiantes
#485 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

@mohgupta-ship-it ya está trabajando en esto.

Desde el 6/9/2026.

  • #486 de @SanHsien — cerrado sin fusionar
  • #490 de @mohgupta-ship-it — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
90/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
tooling

Línea de trabajo

Comienza en scripts/compare_scan_accuracy.py en _RUNTIME_IDENTITY_PROBE e inspecciona cómo se convierte la ruta file:// analizada antes de resolve(strict=True). Ejecuta en Windows tests/unit/test_compare_scan_accuracy.py::test_runtime_probe_hashes_installed_and_editable_dependency_bytes; se considera terminado cuando el test de la dependencia editable pasa sin el error de la letra de unidad duplicada y las comprobaciones de ruff siguen limpias.

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

Descripción

Summary

The runtime identity probe in scripts/compare_scan_accuracy.py converts an editable dependency's direct_url.json file:// URL to a local path with Path(urllib.parse.unquote(parsed.path)). On Windows that produces a doubled drive letter and the subsequent resolve(strict=True) raises.

Where

scripts/compare_scan_accuracy.py, inside _RUNTIME_IDENTITY_PROBE:

editable_root = Path(urllib.parse.unquote(parsed.path)).resolve(strict=True)

Why it breaks

A Windows file:// URL is file:///C:/Users/.../pkg, so urlsplit(...).path is /C:/Users/.../pkg — with a leading slash. Path() reads that slash as a root, so the result is C:\C:\Users\...\pkg:

>>> from urllib.parse import urlsplit, unquote
>>> from pathlib import Path
>>> Path(unquote(urlsplit("file:///C:/Users/me/pkg").path))
WindowsPath('/C:/Users/me/pkg')     # -> resolves against the cwd drive as C:\C:\Users\me\pkg

resolve(strict=True) then raises:

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect:
'C:\C:\Users\...\editable-dependency'

On POSIX the two are identical (/tmp/pkg either way), which is why CI does not see it.

Reproduction

On Windows, with the repo installed as an editable dependency:

uv run pytest tests/unit/test_compare_scan_accuracy.py::test_runtime_probe_hashes_installed_and_editable_dependency_bytes

Fails with the WinError 123 above. This is your existing test, unmodified — it already covers the bug, it just never runs on a Windows host in CI.

Suggested fix

urllib.request.url2pathname is the stdlib function for this conversion and is correct on both platforms:

editable_root = Path(urllib.request.url2pathname(parsed.path)).resolve(strict=True)

Verified on Windows 11 / Python 3.13: the test above goes from failing to passing with that one-line change, and ruff check / ruff format --check stay clean. Happy to open a PR.

Environment

  • Windows 11, native (not WSL)
  • Python 3.13.14, uv 0.12.8
  • SkillSpector 2.11.0 (7805bb9)
Lenguaje dominante
Python
Estrellas
23.2k
Forks
2k
Merge medio
5 d 9 h
PR fusionados (30 d)
121

Preparar el entorno

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 NVIDIA/SkillSpector

Todos los issues de NVIDIA/SkillSpector

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.