You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we said at the pyconfr yesterday, I fill a bug for my strange behaviour.
Context
I generate reports with overflowing table, I have a layout algorithm to split them on multiple pages, I don't use weasyprint table splitting functionnality.
I detect that the table is on multiple pages when I get this error : AttributeError: 'TableCellBox' object has no attribute 'border_top_left_radius' (stacktrace below).
By the way, I realize it's not a terrible idea as this is completely a side effect, I could just... count the number of pages in the generated PDF 🤷
Test env
I managed to create a minimal reproducible build using the project evironment :
Traceback (most recent call last):
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/bin/weasyprint", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/__main__.py", line 194, in main
html.write_pdf(output, **options)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/__init__.py", line 265, in write_pdf
self.render(font_config, counter_style, **options)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/__init__.py", line 222, in render
return Document._render(self, font_config, counter_style, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/document.py", line 266, in _render
[Page(page_box) for page_box in page_boxes],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/__init__.py", line 214, in layout_document
layout_backgrounds(page, context.get_image_from_uri)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 231, in layout_backgrounds
layout_box_backgrounds(page, page, get_image_from_uri)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 45, in layout_box_backgrounds
layout_box_backgrounds(page, child, get_image_from_uri)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 45, in layout_box_backgrounds
layout_box_backgrounds(page, child, get_image_from_uri)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 45, in layout_box_backgrounds
layout_box_backgrounds(page, child, get_image_from_uri)
[Previous line repeated 6 more times]
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 83, in layout_box_backgrounds
layout_background_layer(box, page, style['image_resolution'], *layer)
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/layout/background.py", line 129, in layout_background_layer
clipped_boxes = [cell.rounded_border_box() for cell in cells]
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/formatting_structure/boxes.py", line 269, in rounded_border_box
return self.rounded_box(0, 0, 0, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matthieufalce/Documents/projets/pro/03_omicure/omicure_pdf_report/.venv/lib/python3.12/site-packages/weasyprint/formatting_structure/boxes.py", line 214, in rounded_box
tlrx, tlry = self.border_top_left_radius
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TableCellBox' object has no attribute 'border_top_left_radius'
The text was updated successfully, but these errors were encountered:
Hello,
As we said at the pyconfr yesterday, I fill a bug for my strange behaviour.
Context
I generate reports with overflowing table, I have a layout algorithm to split them on multiple pages, I don't use weasyprint table splitting functionnality.
I detect that the table is on multiple pages when I get this error : AttributeError: 'TableCellBox' object has no attribute 'border_top_left_radius' (stacktrace below).
By the way, I realize it's not a terrible idea as this is completely a side effect, I could just... count the number of pages in the generated PDF 🤷
Test env
I managed to create a minimal reproducible build using the project evironment :
I also reproduced on the latest weasyprint version
And it's present for a long time (at least version 53.4).
I use the CLI interface (but also meet the issue with the python api):
weasyprint overflow.html overflow.pdf
Files
I reduced the issue to 3 files :
Everything can be found here : https://github.com/ice3/weasyprint-repro-attributeerror
In
overflow.html
, I have a table with a lot of row, adding or removing one will crash the program (data are pingu redacted)It loads the file main.css. In this file, removing this rule crashes or not the program :
Stacktrace
The text was updated successfully, but these errors were encountered: