Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Para alguns XML ocorre um erro ao gerar a página HTML do artigo #513

Open
robertatakenaka opened this issue Aug 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@robertatakenaka
Copy link
Member

Descrição do problema

Não identificado o motivo de que para alguns XML, ocorre o problema descrito a seguir:

[2024-07-02 14:54:14,547: ERROR/ForkPoolWorker-4] PreviewArticlePage 2215-5287-mlcr-21-02-101 cannot parse from 'NoneType'
Traceback (most recent call last):
  File "/app/package/models.py", line 629, in generate_article_html_page
    generator = HTMLGenerator.parse(
                ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/packtools/domain.py", line 514, in parse
    et = utils.XML(file)
         ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/packtools/utils.py", line 100, in XML
    xml = etree.parse(file, parser)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3548, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1902, in lxml.etree._parseDocument
TypeError: cannot parse from 'NoneType'
[2024-07-02 14:54:14,585: INFO/ForkPoolWorker-4] Task proc.tasks.task_generate_sps_package[d499c002-8a54-4ff8-98eb-5c5ef7e4b832] succeeded in 4.1396419908851385s: None
[2024-07-02 14:54:14,587: INFO/MainProcess] Task proc.tasks.task_generate_sps_package[46089ceb-61f7-4671-948b-26cd419d2039] received
[2024-07-02 14:54:14,667: INFO/ForkPoolWorker-4] []
[2024-07-02 14:54:14,713: INFO/ForkPoolWorker-4] Posting xml with {'sps_pkg_name': '2215-5287-mlcr-21-02-71', 'pid_v3': '8wJ7b8hjwt64rcfGgpf34Wc', 'pid_v2': 'S1409-00152004000200009', 'aop_pid': None, 'filename': '2215-5287-mlcr-21-02-71.xml', 'files': ['2215-5287-mlcr-21-02-71.xml']}

Passos para reproduzir o problema

Use o xml https://minio.scielo.sa.cr/upload/1021-7444/am/29/01/56/1021-7444-am-29-01-56.xml e a classe HTMLGenerator do packtools
É essencial que seja desta forma, pois é como o opac funciona.

Comportamento esperado

Uso da classe sem levantar exceções

Screenshots ou vídeos

n/a

Anexos

n/a

Ambiente utilizado

n/a

@robertatakenaka robertatakenaka added the bug Something isn't working label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants