bundle catalog add rewrites Windows drive paths as POSIX paths
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza en src/specify_cli/bundles/catalog_config.py en _is_local_path y _canonicalize_url, y rastrea cómo add_source() (alrededor de la línea 184) guarda el resultado. Las rutas de unidad de Windows no deberían pasar por el Path(...).resolve() nativo del host en POSIX; o bien se mantiene el valor tal cual, o se rechaza. Está terminado cuando bundle catalog add C:\catalog.json ya no escribe una URL relativa al directorio actual, y se añade una prueba para ese caso.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
_is_local_path() explicitly recognizes a Windows drive path such as
C:\catalog.json, but _canonicalize_url() then passes it to the host-native
Path(...).resolve(). On Linux and macOS that turns the Windows absolute path
into a path relative to the current project, and add_source() persists the
rewritten value into the catalog configuration.
Environment
- Repository:
github/spec-kit - Target revision:
1c799bda6c136fcf42fb3475a922ccaac57e6c71 - Platform: macOS (POSIX), Python 3.13
- File:
src/specify_cli/bundles/catalog_config.py:96-116
(_is_local_path,_canonicalize_url), used byadd_source()at:184
Expected behavior
A Windows absolute path is either preserved verbatim in the configuration or
rejected as non-local on a POSIX host. It must not be silently rewritten into a
different path.
Actual behavior
Adding C:\catalog.json on macOS persists:
catalogs:
- id: c---catalog
url: /private/tmp/.../project/C:\catalog.json
priority: 50
install_policy: install-allowed
The stored URL points at a non-existent file whose name contains a backslash
and a colon; later catalog reads fail to resolve the intended source.
Root cause
_WINDOWS_DRIVE_RE = re.compile(r"^[A-Za-z]:[\\/]")
def _is_local_path(url: str) -> bool:
if _WINDOWS_DRIVE_RE.match(url):
return True
...
def _canonicalize_url(url: str) -> str:
if _is_local_path(url):
return str(Path(url).expanduser().resolve())
return url
The Windows-drive branch is platform-independent, while Path is host-native.
On POSIX, Path(r"C:\catalog.json").resolve() produces
<cwd>/C:\catalog.json; on Windows it would be absolute. The same function is
reached from the public bundle catalog add path through add_source().
Impact
- A catalog configuration produced on Windows and consumed on Linux/macOS (or a
Windows path passed on a POSIX host) is silently corrupted instead of being
rejected. - The stored catalog id (
c---catalog) and URL both diverge from the user's
input, and the source cannot be loaded.
Suggested fix
Preserve Windows drive paths on non-Windows hosts instead of resolving them
with the host-native Path:
def _canonicalize_url(url: str) -> str:
if _WINDOWS_DRIVE_RE.match(url):
return url # do not reinterpret on POSIX
if _is_local_path(url):
return str(Path(url).expanduser().resolve())
return url
or canonicalize with PureWindowsPath when the host is POSIX and the input
matches the Windows-drive form, and reject the value if it cannot be resolved.
- Lenguaje dominante
- Python
- Estrellas
- 144k
- Forks
- 12.9k
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 181
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/spec-kit
-
The Python branch-creation port accepts an oversized `--number` and crashes at `int()` instead of rejecting itPosiblemente ocupada @github-actions la tomó hace 3 días. Abiertobug-assess bug-fix fix-proposed severity-low triage-can-wait
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/spec-kit#5194 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Cline extension and preset commands have `speckit.*.md` file names rewritten to `speckit-*-md`Posiblemente ocupada @kevin9327 la tomó hace 5 días. Abiertotriage-can-wait
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script acceptsPosiblemente ocupada @WOLIKIMCHENG la tomó hace 7 días. Abiertotriage-can-wait
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Bug]: `bundle init <bundle>` initialises with the default integration instead of the bundle's, then aborts with a clashPosiblemente ocupada @chelsealong la tomó hace 9 días. Abiertotriage-must-have
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[Bug]: `specify preset set-priority` does not update agent command files that are already writtenPosiblemente ocupada @mikamikasuki la tomó hace 8 días. Abiertotriage-must-have
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
Todos los issues de github/spec-kit
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
elviskahoro/sdk-python-attio#144 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
RenyiELBO raises TypeError when model has no sample sitesPosiblemente ocupada @alibb007 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[Bug]: Four evaluation scripts unpack init_memmachine_params's five return values into three namesAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
MemMachine/MemMachine#1911 ·
Los mantenedores suelen responder en 3 días