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

KeyError trying to make pdf of weasyprint.org #1429

Closed
RosanneZe opened this issue Aug 27, 2021 · 4 comments
Closed

KeyError trying to make pdf of weasyprint.org #1429

RosanneZe opened this issue Aug 27, 2021 · 4 comments
Labels
crash Problems preventing documents from being rendered
Milestone

Comments

@RosanneZe
Copy link

I'm trying to update my Dockerfile to use Weasyprint 53.1. I changed quite a few of the installs and some work around pip dependencies that made version 52 work. It took a bit of trial and error, but I now get no errors during the install. To test my installation I ran the example from the documentation:

 $ weasyprint http://weasyprint.org /tmp/weasyprint-website.pdf

This gave a KeyError:

File "/usr/local/lib/python3.8/dist-packages/weasyprint/layout/flex.py", line 113, in flex_layout
    children = children[skip_stack[0]:]
KeyError: 0

I also got this same error when I tried it in my local environment, in which my pdf tests work, so I don't think this has anything to do with the installation.

@grewn0uille
Copy link
Member

Hello!
We have the same error with master but not with v53.1. How do you install WeasyPrint in your Dockerfile?

@RosanneZe
Copy link
Author

I installed it with pip in root with the dependencies as specified in the documentation. But I also got the error in my local environment in a virtualenv. I did not update the dependencies there, only updated weasyprint, but my pdf's are still generated correctly.

@grewn0uille
Copy link
Member

Hm, I’m able to reproduce by using pip to install WeasyPrint instead of using the git tag.
It seems that the Pypi release contains code from a commit of master… We’re going to do a new release very soon to fix that.

Thanks a lot for your report!

@liZe liZe added this to the 53.2 milestone Aug 27, 2021
@liZe liZe added the crash Problems preventing documents from being rendered label Aug 27, 2021
@grewn0uille
Copy link
Member

v53.2 has been released. It should be fixed :)

liZe added a commit that referenced this issue Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

3 participants