WeasyPrint: IndexError: tuple index out of range with weasyprint 50

After upgrading to 50 from 49 I got the following error when generating a PDF:

IndexError: tuple index out of range
[...]
  File "weasyprint/layout/blocks.py", line 63, in block_level_layout
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "weasyprint/layout/blocks.py", line 130, in block_box_layout
    absolute_boxes, fixed_boxes, adjoining_margins)
  File "weasyprint/layout/blocks.py", line 376, in block_container_layout
    for line, resume_at in lines_iterator:
  File "weasyprint/layout/inlines.py", line 53, in iter_line_boxes
    absolute_boxes, fixed_boxes, first_letter_style)
  File "weasyprint/layout/inlines.py", line 70, in get_next_linebox
    skip_stack = skip_first_whitespace(linebox, skip_stack)
  File "weasyprint/layout/inlines.py", line 210, in skip_first_whitespace
    result = skip_first_whitespace(box.children[index], next_skip_stack)

Downgrading to 49 prevents this error. Possibly similar to #783? I will try to come up with a test case when I find some time.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I tried it out, and #956 does fix the conversion time! Back the 30seconds for the whole novel, just like in WeasyPrint 49.