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

HTML.render() got multiple values for argument 'font_config' with Weasyprint 59 #71

Closed
floek opened this issue May 14, 2023 · 3 comments

Comments

@floek
Copy link

floek commented May 14, 2023

Hi,
it seems weasyprint changed its API with v59 and the signature of HTML.render() hast changed.
See: https://github.com/Kozea/WeasyPrint/releases/tag/v59.0b1

As a result, django-weasyprint throws an exception with Weasyprint v59:

  File ".../venv/lib/python3.11/site-packages/django_weasyprint/views.py", line 91, in rendered_content
    document = self.get_document()
               ^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/django_weasyprint/views.py", line 81, in get_document
    return html.render(
           ^^^^^^^^^^^^
TypeError: HTML.render() got multiple values for argument 'font_config'

Maybe you could adapt to the changed API. Thank you!

Best,
Floek

@troeger
Copy link

troeger commented May 15, 2023

You can explicitely install the previous version of weasyprint, before django-weasyprint, in order to work around that problem:

pip install weasyprint==58.0

@liZe
Copy link
Contributor

liZe commented May 15, 2023

A pull request has been open to fix this: #70.

dragon-dxw added a commit to nationalarchives/ds-caselaw-public-ui that referenced this issue May 15, 2023
laudrup added a commit to laudrup/ebbamaala that referenced this issue May 17, 2023
As a workaround for:
fdemmer/django-weasyprint#71

For using weasyprint 0.58 until django-weasyprint has been updated for
weasyprint 0.59.
laudrup added a commit to laudrup/ebbamaala that referenced this issue May 17, 2023
As a workaround for:
fdemmer/django-weasyprint#71

For using weasyprint 0.58 until django-weasyprint has been updated for
weasyprint 0.59.
laudrup added a commit to laudrup/ebbamaala that referenced this issue May 17, 2023
As a workaround for:
fdemmer/django-weasyprint#71

For using weasyprint 0.58 until django-weasyprint has been updated for
weasyprint 0.59.
laudrup added a commit to laudrup/ebbamaala that referenced this issue May 17, 2023
As a workaround for:
fdemmer/django-weasyprint#71

For using weasyprint 0.58 until django-weasyprint has been updated for
weasyprint 0.59.
@fdemmer
Copy link
Owner

fdemmer commented Aug 17, 2023

fixed in v2.2.1

@fdemmer fdemmer closed this as completed Aug 17, 2023
ivanbrizuela added a commit to ivanbrizuela/django-weasyprint that referenced this issue Sep 19, 2023
- Support WeasyPrint v59.0 (fdemmer#71)
- Add Python 3.11 and Django 4.2 to test matrix, remove Python 3.6 and 3.7
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

4 participants