Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

adapter.aasx: Missing supplementary file aborts reading with failsafe

Aperta Adatta ai principianti
#665 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, databases

Direzione di ricerca

Inizia da _add_supplementary_file() e dalla chiamata a open_part() in sdk/basyx/aas/adapter/aasx.py alle righe collegate. Controlla come i percorsi di lettura esistenti gestiscono le parti mancanti del pacchetto e come viene testata la modalità failsafe. Il lavoro è concluso quando una parte supplementare mancante viene registrata e ignorata con failsafe=True, mentre failsafe=False genera un errore chiaro.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug good-first-issue sdk

AASXReader.read_into() raises KeyError when a File element
or the default thumbnail points to a part that is not in the package,
even with failsafe=True:

https://github.com/eclipse-basyx/basyx-python-sdk/blob/2773ac069d3163cbbd32c3c634813d38bbe521ad/sdk/basyx/aas/adapter/aasx.py#L396-L405

The object is already in the object_store at that point, so the
read stops half-way.

Steps to reproduce:

sm = model.Submodel("urn:sm:1", submodel_element=[
    model.File("f", "application/pdf", "/aasx/missing.pdf")])
# the writer only logs a warning and writes the package
with aasx.AASXWriter("x.aasx", failsafe=True) as w:
    w.write_all_aas_objects(
        "/aasx/data.json", model.DictIdentifiableStore([sm]),
        aasx.DictSupplementaryFileContainer())
with aasx.AASXReader("x.aasx", failsafe=True) as r:
    r.read_into(model.DictIdentifiableStore(),
                aasx.DictSupplementaryFileContainer())
# KeyError: 'Could not find part /aasx/missing.pdf in package'

The repository server calls load_directory() at import, so one such
file in INPUT stops the container from starting.

Expected behavior: With failsafe=True, the missing part is
logged and skipped, like other defects. With failsafe=False, a clear
error is raised.

Actual behavior: KeyError in both modes; the objects read so far
stay in the store.

Environment: develop @ 2773ac06.

Possible fix: Catch KeyError around open_part() in
_add_supplementary_file(): log and return None if failsafe,
otherwise re-raise. Our own writer produces such packages in failsafe
mode (see #228), so the reader should accept them.

Lingua principale
Python
Stelle
106
Fork
59
Merge medio
4g 1h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-basyx/basyx-python-sdk

Tutte le issue di eclipse-basyx/basyx-python-sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.