Open ice3 opened 1 week ago
Thanks for the report!
Hereβs a small sample to reproduce (size may depend on default system font):
<style>
@page {size: 200mm 10em}
.col {background: red}
</style>
<table>
<colgroup>
<col class="col"/>
</colgroup>
<tbody>
<tr><td>cell</td></tr>
<tr><td>cell</td></tr>
</tbody>
</table>
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