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

Media hrefs resolve case-sensitively: Windows-authored folders get false missing-media on Linux

Cerrado
#34 1 comentario 0 reacciones 1 asignado Ver en GitHub

@imnasnainaec ya está trabajando en esto.

Desde el 22/9/2026.

  • #47 de @imnasnainaec — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
tooling

Línea de trabajo

Empieza en src/sil_lift/_model.py, en missing_media(), y compara su sondeo de dos candidatos con _existing_file y el cambio de resolución del archivo acompañante en #19. Decide entre una fusión silenciosa, un hallazgo de discrepancia entre mayúsculas y minúsculas de medios o documentación; terminado significa que el comportamiento elegido está cubierto y que la búsqueda de directorios en caché gestiona el bucle completo de medios.

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

Descripción

bug

Lexicon.missing_media() resolves <media> and <illustration> hrefs with a plain is_file(), so a folder authored on Windows reports files as missing when it is read on a case-sensitive filesystem.

Dict.lift            <illustration href="pictures\SDD.PNG"/>
pictures/sdd.png

Loads clean on Windows; on Linux sil-lift validate warns missing-media, and --strict fails the run. The image is right there.

The lookup is the two-candidate probe in missing_media() (src/sil_lift/_model.py):

candidates = [base / relative, base / subfolder[ref.kind] / relative]
if not any(candidate.is_file() for candidate in candidates):

This is the same Windows-authored/Linux-read mismatch that #19 fixed for .lift-ranges companions, in the one other place the library touches the filesystem.

Why this is not just "call _existing_file here too"

For a companion, folding the name is unambiguously right: resolve it or silently lose every range it defines. For media the opposite argument has real force. If an illustration href says SDD.PNG and the file is sdd.png, a web export, an APK build, or anything else serving that folder from a case-sensitive host will 404. A validator that silently resolves the mismatch reports a clean bill for a dictionary that is genuinely broken downstream — hiding the defect the check exists to surface.

Options:

  • A. Fold silently. ~6 source lines. Consistent with companion resolution, kills the false positives, hides genuine portability defects.
  • B. Fold, but report the mismatch as its own finding (media-case-mismatch, warning). missing-media goes back to meaning "no such file under any spelling"; the new code says "found, but only case-insensitively — this will not survive a case-sensitive host." Costs a new problem code, which is a SemVer-covered interface here.
  • C. Leave it, document it. The status quo is at least honest about the portability problem, just unhelpfully worded and noisy.

B looks right, but it is a real interface decision and wants a deliberate call rather than a drive-by.

Two things to settle either way

  • Only the final path component folds. _existing_file searches one directory listing for a name; it does not fold directory components. Media hrefs routinely include pictures/ and audio/, so Pictures\x.png against an on-disk pictures/ would still misreport. Whether to fold directory components is more pressing here than it was for companions, where hrefs are basenames or same-folder relatives.
  • Cost. missing_media() iterates every media ref in the document — thousands in a real dictionary — and media folders are large. _existing_file's listings cache has to be threaded across the whole loop so it is one directory read per folder per call, not one per reference.

Rough size

Option A: ~50 lines over 3 files. Option B: ~200-250 lines over ~10 — _model.py, _validate.py, _cli.py, docs/en/guides/{validate,cli,lift-export-interop}.md, a negative corpus fixture plus its PROVENANCE.md entry, test_validate.py, test_cli.py, and CHANGELOG.md.

Split out of review discussion on #19, which deliberately kept its scope to companion resolution.

Lenguaje dominante
Python
Estrellas
1
Forks
0
Merge medio
11 d 8 h
PR fusionados (30 d)
3

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 sillsdev/python-sil-lift

Todos los issues de sillsdev/python-sil-lift

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.