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
Traceback (most recent call last):
File "./test-weasyprint-error.py", line 25, in <module>
weasyprint.HTML(string=HTML_DOC).write_pdf('test.pdf')
File ".../lib/python3.8/site-packages/weasyprint/__init__.py", line 222, in write_pdf
self.render(
File ".../lib/python3.8/site-packages/weasyprint/__init__.py", line 172, in render
return Document._render(
File ".../lib/python3.8/site-packages/weasyprint/document.py", line 406, in _render
[Page(page_box, enable_hinting) for page_box in page_boxes],
File ".../lib/python3.8/site-packages/weasyprint/document.py", line 406, in <listcomp>
[Page(page_box, enable_hinting) for page_box in page_boxes],
File ".../lib/python3.8/site-packages/weasyprint/layout/__init__.py", line 123, in layout_document
pages = list(make_all_pages(context, root_box, html, pages))
File ".../lib/python3.8/site-packages/weasyprint/layout/pages.py", line 800, in make_all_pages
page, resume_at = remake_page(i, context, root_box, html)
File ".../lib/python3.8/site-packages/weasyprint/layout/pages.py", line 729, in remake_page
set_page_type_computed_styles(page_type, html, context.style_for)
File ".../lib/python3.8/site-packages/weasyprint/layout/pages.py", line 686, in set_page_type_computed_styles
style_for.set_computed_styles(
File ".../lib/python3.8/site-packages/weasyprint/css/__init__.py", line 164, in set_computed_styles
computed_styles[element, pseudo_type] = computed_from_cascaded(
File ".../lib/python3.8/site-packages/weasyprint/css/__init__.py", line 667, in computed_from_cascaded
return computed_values.compute(
File ".../lib/python3.8/site-packages/weasyprint/css/computed_values.py", line 268, in compute
value[i], already_computed_value = compute_variable(
File ".../lib/python3.8/site-packages/weasyprint/css/computed_values.py", line 213, in compute_variable
value, = new_value
ValueError: too many values to unpack (expected 1)
The text was updated successfully, but these errors were encountered:
Thanks a lot for this report. The bug is caused by #1165, and it once again shows how calculated values are broken in WeasyPrint and prevent a sane use of functions (var for you, but it’s the same for attr).
I’m afraid there’s no easy fix. As explained in #1165, rewriting this whole code is the only solution to fix bugs like this one, and to handle functions correctly.
I try to upgrade to latest version of WeasyPrint (52.2), but my code raises exception:
ValueError: too many values to unpack (expected 1)
in File weasyprint/css/computed_values.py", line 213, in compute_variable
This error is raised with WeasyPrint version 52.2,
I try with Python 3.8.3 (on Linux)
(note it was working correctly with WeasyPrint version 51)
Try the test-script:
It raises following exception:
The text was updated successfully, but these errors were encountered: