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

'unicode' is not defined with alpine #13

Open
FabriceMailleferObjectis opened this issue May 20, 2022 · 0 comments
Open

'unicode' is not defined with alpine #13

FabriceMailleferObjectis opened this issue May 20, 2022 · 0 comments

Comments

@FabriceMailleferObjectis

I got the following error when generating a PDF from HTML with the "alpine" tag:

[2022-05-20 08:10:41,195] ERROR in app: Exception on /pdf [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "app.py", line 15, in pdf
doc = handle_request(config)
File "app.py", line 44, in handle_request
pdf = pdfkit.from_string(unicode(request.form['html']), output_path=False, configuration=config, options=options)
NameError: name 'unicode' is not defined

I tried with the docker image with "latest" tag based on Debian, it works as expected.

How can I update the dockerfile or app.py to make it works also on alpine?

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

1 participant