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

Weasyprint chokes on some HTML (layout bug?) #580

Closed
sjdv1982 opened this issue Feb 26, 2018 · 2 comments
Closed

Weasyprint chokes on some HTML (layout bug?) #580

sjdv1982 opened this issue Feb 26, 2018 · 2 comments
Labels
bug Existing features not working as expected crash Problems preventing documents from being rendered
Milestone

Comments

@sjdv1982
Copy link

sjdv1982 commented Feb 26, 2018

Minimal HTML attached: bug.html.txt
Random changes to the text make the bug (dis)appear.

It happens in both the PyPI and the master branch of weasyprint. I am on Kubuntu with the following rendering libraries:

libcairo2/artful,now 1.14.10-1ubuntu1 amd64 [installed]
libgdk-pixbuf2.0-0/artful-updates,artful-security,now 2.36.11-1ubuntu0.1 amd64 [installed]
libpango-1.0-0/artful,now 1.40.12-1 amd64 [installed]
libpangocairo-1.0-0/artful,now 1.40.12-1 amd64 [installed]

Error message:

Traceback (most recent call last):
  File "/usr/local/bin/weasyprint", line 11, in <module>
    sys.exit(main())
  File "/home/sjoerd/github/PYTHON/weasyprint/__main__.py", line 173, in main
    getattr(html, 'write_' + format_)(output, **kwargs)
  File "/home/sjoerd/github/PYTHON/weasyprint/__init__.py", line 185, in write_pdf
    font_config=font_config).write_pdf(
  File "/home/sjoerd/github/PYTHON/weasyprint/__init__.py", line 146, in render
    font_config)
  File "/home/sjoerd/github/PYTHON/weasyprint/document.py", line 316, in _render
    [Page(p, enable_hinting) for p in page_boxes],
  File "/home/sjoerd/github/PYTHON/weasyprint/document.py", line 316, in <listcomp>
    [Page(p, enable_hinting) for p in page_boxes],
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/__init__.py", line 53, in layout_document
    context, root_box, html, cascaded_styles, computed_styles))
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/pages.py", line 600, in make_all_pages
    context, root_box, page_type, resume_at, page_number)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/pages.py", line 519, in make_page
    positioned_boxes, positioned_boxes, adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 79, in block_level_layout
    adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 107, in block_box_layout
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 640, in block_container_layout
    adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 79, in block_level_layout
    adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 107, in block_box_layout
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/blocks.py", line 512, in block_container_layout
    for line, resume_at in lines_iterator:
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/inlines.py", line 49, in iter_line_boxes
    device_size, absolute_boxes, fixed_boxes, first_letter_style)
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/inlines.py", line 106, in get_next_linebox
    waiting_floats, line_children=[])
  File "/home/sjoerd/github/PYTHON/weasyprint/layout/inlines.py", line 839, in split_inline_box
    child_resume_at[0] + current_skip,
TypeError: 'NoneType' object is not subscriptable
@liZe liZe closed this as completed in d695044 Feb 27, 2018
@liZe
Copy link
Member

liZe commented Feb 27, 2018

Thanks for this report! It's should be fixed in master now.

@liZe liZe added crash Problems preventing documents from being rendered bug Existing features not working as expected regression labels Feb 27, 2018
@liZe liZe added this to the 43 milestone Feb 27, 2018
@sjdv1982
Copy link
Author

Works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

2 participants