Skip to content

Signals.SIGSEGV: 11 Error with Python 3.9 #180

@thomasphilibert

Description

@thomasphilibert

Hello guys,

I have just trying to move from python 3.7 to pythhon 3.9 and now, i get an error with django-wkhtmltopdf when i generate a PDF:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/unittest/mock.py", line 1337, in patched
    return func(*newargs, **newkeywargs)
  File "/home/company/code/kit/tests/test_create_kit_form.py", line 533, in test_report_access
    kit_order.completed(post_form.request)
  File "/home/company/code/kit/models.py", line 229, in completed
    self.generate_invoice(request)
  File "/home/company/code/order/models.py", line 40, in generate_invoice
    print(response.rendered_content)
  File "/usr/local/lib/python3.9/site-packages/wkhtmltopdf/views.py", line 73, in rendered_content
    return render_pdf_from_template(
  File "/usr/local/lib/python3.9/site-packages/wkhtmltopdf/utils.py", line 232, in render_pdf_from_template
    return convert_to_pdf(filename=input_file.filename,
  File "/usr/local/lib/python3.9/site-packages/wkhtmltopdf/utils.py", line 165, in convert_to_pdf
    return wkhtmltopdf(pages=pages, **cmd_options)
  File "/usr/local/lib/python3.9/site-packages/wkhtmltopdf/utils.py", line 146, in wkhtmltopdf
    return check_output(ck_args, **ck_kwargs)
  File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['wkhtmltopdf', '--encoding', 'utf8', '--quiet', '/tmp/wkhtmltopdfbb5l238z.html', '-']' died with <Signals.SIGSEGV: 11>.

It seems to come from rendered_content.

I use wkhtmltopdf 0.12.6

All work fine with 3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions