You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my printout, which In this instance, sum(added_widths becomes zero, and we have a zero-division.
I did some testing, and changed this line from if assignable_width <= sum(max_content_guess): to if assignable_width < sum(max_content_guess): which helped in my case. I have a feeling that's not safeguarding the zero-division though, but only sidestepping the issue for my use-case.
I tested this both with python-weasyprint-62.3-2 using the installation on my laptop and weasyprint-63 using a virtual env
I can't share the html file I'm trying to convert, but if there's a way I can figure out what lines is causing this, I can see if there's sensitive information and possibly share that part.
The text was updated successfully, but these errors were encountered:
Thanks for the report. We already discussed about it in #2276 and got a document to reproduce, but we didn’t take the time yet to fix it and add a non-regression test.
I did some testing, and changed this line from if assignable_width <= sum(max_content_guess): to if assignable_width < sum(max_content_guess): which helped in my case.
I think that this change makes sense: if the assignable width equals to the max-content guess, and the added widths can be 0. In this case, we can use the max-content guess values, as done in the else part.
There is a chance for a zero-division error in
weasyprint/layout/table.py
this lineA few lines prior, it checks for equality between the lists, but it doesn't account for
upper_guess - lower_guess
becoming a list that sums to zeroe.g.:
This is my printout, which In this instance,
sum(added_widths
becomes zero, and we have a zero-division.I did some testing, and changed this line from
if assignable_width <= sum(max_content_guess):
toif assignable_width < sum(max_content_guess):
which helped in my case. I have a feeling that's not safeguarding the zero-division though, but only sidestepping the issue for my use-case.I tested this both with python-weasyprint-62.3-2 using the installation on my laptop and weasyprint-63 using a virtual env
I can't share the html file I'm trying to convert, but if there's a way I can figure out what lines is causing this, I can see if there's sensitive information and possibly share that part.
The text was updated successfully, but these errors were encountered: