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
Process interruption (using ctrl+c) gives a traceback as follow:
Traceback (most recent call last):
File "html2pdf_case1.py", line 61, in <module>
HTML(string=content).write_pdf(io.BytesIO())
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/__init__.py", line 211, in write_pdf
font_config=font_config).write_pdf(
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/__init__.py", line 168, in render
font_config)
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/document.py", line 393, in _render
[Page(page_box, enable_hinting) for page_box in page_boxes],
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/document.py", line 393, in <listcomp>
[Page(page_box, enable_hinting) for page_box in page_boxes],
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/layout/__init__.py", line 116, in layout_document
initialize_page_maker(context, root_box)
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/layout/__init__.py", line 54, in initialize_page_maker
next_page = {'break': 'any', 'page': root_box.page_values()[0]}
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
[Previous line repeated 1 more time]
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
[Previous line repeated 1 more time]
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 375, in page_values
start_value = start_box.page_values()[0] or start_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 376, in page_values
end_value = end_box.page_values()[1] or end_value
File "weasyprint_env/lib/python3.7/site-packages/weasyprint/formatting_structure/boxes.py", line 373, in page_valuesifself.children:
KeyboardInterrupt
The text was updated successfully, but these errors were encountered:
The problem is in page_values that gets called way too many times. Adding a cache fixes the problem, but there’s probably a clean way to fix the algorithm.
Hi!
I've got a html test case which causes sth what looks like an infinite loop or at least a very long (too long) layout formatting.
Steps to reproduce:
The
html2pdf_case1.py
file:Process interruption (using ctrl+c) gives a traceback as follow:
The text was updated successfully, but these errors were encountered: