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

Signals.SIGSEGV: 11 Error with Python 3.9 #180

Open
thomasphilibert opened this issue Mar 19, 2021 · 1 comment
Open

Signals.SIGSEGV: 11 Error with Python 3.9 #180

thomasphilibert opened this issue Mar 19, 2021 · 1 comment

Comments

@thomasphilibert
Copy link

thomasphilibert commented Mar 19, 2021

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

@thomasphilibert thomasphilibert changed the title Signals.SIGSEGV: 11 on new Apple M1 processor Signals.SIGSEGV: 11 Error with Python 3.9 Mar 19, 2021
@maxpeterson
Copy link
Member

@thomasphilibert from the stack trace it looks like the call to wkhtmltopdf is failing. I am not sure why it would be any different between between Python 3.7 and 3.9.

Since it works with 3.7 we can assume that wkhtmltopdf is working correctly on your system. Is it possible for you to try calling wkhtmltopdf from a Python 3.9 script to see if that works?

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