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

Aberta
#1,331 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
15/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
perl, python
Domínio
data

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
C
Estrelas
10
Forks
8
Merge médio
6h 32min
PRs com merge (30d)
1

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de FriendsofECCE/ECCE

Todas as issues de FriendsofECCE/ECCE

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.