Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot unpack non-iterable BlockBox object in Manjaro Linux #1552

Closed
mgazzin opened this issue Jan 26, 2022 · 1 comment
Closed

cannot unpack non-iterable BlockBox object in Manjaro Linux #1552

mgazzin opened this issue Jan 26, 2022 · 1 comment

Comments

@mgazzin
Copy link

mgazzin commented Jan 26, 2022

Hello, in my x86_64 machine I did:

docker pull manjarolinux/base
docker run -it manjarolinux/base bash
# pacman -Syyu
# pacman -S python-pip pango
# pip install -U weasyprint
# weasyprint http://weasyprint.org /tmp/weasyprint-website.pdf

I am getting the following error:

WARNING: Invalid media type ' screen and (min-width: 831px) ' the whole @media rule was ignored at 1029:1.
Traceback (most recent call last):
  File "/usr/bin/weasyprint", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/weasyprint/__main__.py", line 188, in main
    html.write_pdf(output, **kwargs)
  File "/usr/lib/python3.10/site-packages/weasyprint/__init__.py", line 183, in write_pdf
    self.render(
  File "/usr/lib/python3.10/site-packages/weasyprint/__init__.py", line 134, in render
    return Document._render(
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 930, in _render
    [Page(page_box) for page_box in page_boxes],
  File "/usr/lib/python3.10/site-packages/weasyprint/document.py", line 930, in <listcomp>
    [Page(page_box) for page_box in page_boxes],
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/__init__.py", line 133, in layout_document
    pages = list(make_all_pages(context, root_box, html, pages))
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/page.py", line 850, in make_all_pages
    page, resume_at = remake_page(i, context, root_box, html)
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/page.py", line 787, in remake_page
    page, resume_at, next_page = make_page(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/page.py", line 585, in make_page
    root_box, resume_at, next_page, _, _ = block_level_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 51, in block_level_layout
    return block_level_layout_switch(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 65, in block_level_layout_switch
    return block_box_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 107, in block_box_layout
    result = block_container_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 636, in block_container_layout
    next_page, new_children) = _in_flow_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 443, in _in_flow_layout
    collapsing_through) = block_level_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 51, in block_level_layout
    return block_level_layout_switch(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 65, in block_level_layout_switch
    return block_box_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 107, in block_box_layout
    result = block_container_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 636, in block_container_layout
    next_page, new_children) = _in_flow_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 443, in _in_flow_layout
    collapsing_through) = block_level_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 51, in block_level_layout
    return block_level_layout_switch(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 65, in block_level_layout_switch
    return block_box_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 107, in block_box_layout
    result = block_container_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/block.py", line 719, in block_container_layout
    absolute_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/absolute.py", line 272, in absolute_layout
    new_box, resume_at = absolute_box_layout(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/absolute.py", line 307, in absolute_box_layout
    new_box, resume_at = absolute_flex(
  File "/usr/lib/python3.10/site-packages/weasyprint/layout/absolute.py", line 234, in absolute_flex
    cb_x, cb_y, cb_width, cb_height = containing_block_sizes
TypeError: cannot unpack non-iterable BlockBox object

this is the installed version:

root@87a06f066b1f /]# weasyprint --version
/usr/lib/python3.10/site-packages/weasyprint/text/fonts.py:73: UserWarning: FontConfig: No fonts configured. Expect ugly output.
  warnings.warn(
WeasyPrint version 54.0
@grewn0uille
Copy link
Member

Hello!
Thanks for the bug report. It’s a duplicate of #1536.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants