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

Crash: AttributeError: 'BlockBox' object has no attribute 'index' #44

Closed
Smylers opened this issue Mar 13, 2013 · 1 comment
Closed

Comments

@Smylers
Copy link
Contributor

Smylers commented Mar 13, 2013

WeasyPrint crashes on this input: http://www.stripey.com/demo/weasyprint/float_dd_ul_crash.html

I've checked with version 0.17. The stack trace is below.

It works fine if the height of the spacer <div> is either reduced to 6.5in or increased to 6.8in.

Traceback (most recent call last):
File "/usr/local/bin/weasyprint", line 9, in
load_entry_point('WeasyPrint==0.17', 'console_scripts', 'weasyprint')()
File "/usr/local/lib/python2.7/dist-packages/weasyprint/main.py", line 141, in main
getattr(html, 'write_' + format_)(output, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/init.py", line 159, in write_pdf
return self.render(stylesheets).write_pdf(target, zoom)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/init.py", line 131, in render
return Document._render(self, stylesheets, enable_hinting)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/document.py", line 251, in _render
return cls([Page(p, enable_hinting) for p in page_boxes])
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/init.py", line 52, in layout_document
pages = list(make_all_pages(context, root_box))
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/pages.py", line 539, in make_all_pages
context, root_box, page_type, resume_at, content_empty)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/pages.py", line 504, in make_page
positioned_boxes, positioned_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 59, in block_level_layout
absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 87, in block_box_layout
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 402, in block_container_layout
adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 59, in block_level_layout
absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 87, in block_box_layout
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 402, in block_container_layout
adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 59, in block_level_layout
absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 87, in block_box_layout
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 445, in block_container_layout
new_children, absolute_boxes, fixed_boxes)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/layout/blocks.py", line 653, in find_earlier_page_break
resume_at = (children[index].index, None)
AttributeError: 'BlockBox' object has no attribute 'index'

@SimonSapin
Copy link
Member

Fixed, thanks!

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