Excited-state parsers: errors="replace" and Perl byte passthrough differ for a stray byte inside a captured label (#868)

Aperta
#1,331 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
perl, python
Ambito
data

Direzione di ricerca

Start with the Gaussian 16 excited-state parser: the Excited State n: label is captured with (.*?) and written to EXCISYM, and the committed fixture is tests/parsers/fixtures/gaussian-16/h2co_tddft_stray_in_state.log. Compare the Python output against the Perl original on origin/main for that fixture. The work is blocked on a maintainer decision between keeping U+FFFD and reproducing raw bytes with surrogateescape, so do not register the case until that is settled.

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

Descrizione

The Python ports of the excited-state parsers (#868) decode job output with errors="replace"; the Perl originals read bytes. A stray invalid byte on a line no pattern matches is harmless in both. It matters only inside a matched line.

Tested with fixtures derived from h2co_tddft (tests/parsers/fixtures/{gaussian-16/h2co_tddft_stray_in_state.log,orca/h2co_tddft_stray_in_state.out}), original Perl from origin/main against the Python on the branch:

  • ORCA (orca.excited): bytes placed in the \S+ fields of a STATE n: line, a transition line and a spectrum row. No capture group can hold a byte, so output is byte-identical to Perl and to the clean fixture. Registered as orca-h2co-tddft-stray-in-state; the golden is byte-identical to the one the Perl produces.
  • Gaussian 16 (gaussian-16.excited): bytes placed in the Excited State n: label, which is captured with (.*?) and written to EXCISYM. They differ: Perl writes the raw byte (0xFF, 0xFE); Python writes U+FFFD (EF BF BD per byte). Everything else in the output is identical.

Open decision: keep U+FFFD (valid UTF-8 downstream, loses the original byte) or reproduce Perl's raw bytes (needs errors="surrogateescape" on stdin and stdout, and puts invalid UTF-8 into a property value). The G16 fixture is committed but not registered as a case until this is decided.

Related: a valid UTF-8 non-breaking space (C2 A0) matches \s in Python text mode but not in Perl's byte regexes. Not covered by these fixtures.

Branch: cx/868-excited.

Lingua principale
C
Stelle
10
Fork
8
Merge medio
6h 32m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 FriendsofECCE/ECCE

Tutte le issue di FriendsofECCE/ECCE

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.