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
I just stumbled over this.. Its my fault my algo should introduce missing table cells - so please don't loose any sleep over this. But maybe you want to check for a nonzero other_columns_contributions when trying to collect the widths of other columns. In this screwd example, wp raises a divison by zero exception.
I:\x3rdParty\Python
Traceback (most recent call last):
File "I:\x3rdParty\Python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "I:\x3rdParty\Python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\__main__.py", line 177, in <module>
main()
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\__main__.py", line 173, in main
getattr(html, 'write_' + format_)(output, **kwargs)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\__init__.py", line 198, in write_pdf
font_config=font_config).write_pdf(
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\__init__.py", line 159, in render
font_config)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\document.py", line 361, in _render
[Page(p, enable_hinting) for p in page_boxes],
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\document.py", line 361, in <listcomp>
[Page(p, enable_hinting) for p in page_boxes],
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\__init__.py", line 126, in layout_document
context, root_box, html, cascaded_styles, computed_styles, pages))
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\pages.py", line 788, in make_all_pages
i, context, root_box, html, cascaded_styles, computed_styles)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\pages.py", line 726, in remake_page
page_number, page_state)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\pages.py", line 554, in make_page
positioned_boxes, positioned_boxes, adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 55, in block_level_layout
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 71, in block_level_layout_switch
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 125, in block_box_layout
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 495, in block_container_layout
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 55, in block_level_layout
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 71, in block_level_layout_switch
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 125, in block_box_layout
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 495, in block_container_layout
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 55, in block_level_layout
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 71, in block_level_layout_switch
adjoining_margins)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\blocks.py", line 119, in block_box_layout
context, box, (containing_block.width, containing_block.height))
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\tables.py", line 627, in table_wrapper_width
auto_table_layout(context, wrapper, containing_block)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\tables.py", line 526, in auto_table_layout
table_and_columns_preferred_widths(context, box, outer=False)
File "I:\x3rdParty\Python\lib\site-packages\weasyprint\layout\preferred.py", line 473, in table_and_columns_preferred_widths
ratio = 1 / len(other_columns_contributions)
ZeroDivisionError: division by zero
I:\xClients\Crown-Temp\WP-crashOnExpand>
It doesnt crash when the 2nd table gets the missing cell. Or when the expand class is removed.
The text was updated successfully, but these errors were encountered:
I just stumbled over this.. Its my fault my algo should introduce missing table cells - so please don't loose any sleep over this. But maybe you want to check for a nonzero
other_columns_contributions
when trying to collect the widths of other columns. In this screwd example, wp raises a divison by zero exception.crashes with:
It doesnt crash when the 2nd table gets the missing cell. Or when the expand class is removed.
The text was updated successfully, but these errors were encountered: