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

got exception : <class 'IndexError'> : list index out of range #1009

Closed
em1le opened this issue Dec 18, 2019 · 2 comments
Closed

got exception : <class 'IndexError'> : list index out of range #1009

em1le opened this issue Dec 18, 2019 · 2 comments

Comments

@em1le
Copy link

em1le commented Dec 18, 2019

Hi there, i just got a bug.

Here is the stack trace :

weasyprint/layout/inlines.py in skip_first_whitespace at line 210

        return (index, None) if index else None
    if isinstance(box, (boxes.LineBox, boxes.InlineBox)):
        if index == 0 and not box.children:
            return None
        result = skip_first_whitespace(box.children[index], next_skip_stack)
        if result == 'continue':
            index += 1
            if index >= len(box.children):
                return 'continue'
            result = skip_first_whitespace(box.children[index], None)
box  | <InlineBox br>
index | 8
next_skip_stack | None
skip_stack | [8, None]

I do not have any clue where does that come from.

If i may help with more details, let me know.

@em1le
Copy link
Author

em1le commented Dec 18, 2019

Quick fix found in #783 by @knixeur in its first comment

@em1le em1le closed this as completed Dec 18, 2019
@knixeur
Copy link

knixeur commented Dec 18, 2019

Glad you sorted it out, however that was a quick fix to keep working, you should try using the version from master in this repo to see if the real fix is already included. Otherwise if you could provide a simple sample to reproduce it it would be great.

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