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

Abierto
#1,331 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
15/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
perl, python
Área
data

Línea de trabajo

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.

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

Descripción

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.

Lenguaje dominante
C
Estrellas
10
Forks
8
Merge medio
6 h 32 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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

Todos los issues de FriendsofECCE/ECCE

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.