This template return 500 error when i put special latin characters like ñ or tildes in a html file. UnicodeDecodeError, invalid continuation byte
DanRows opened this issue · 3 comments
Hello good morning, im testing our flask volt template, but every time when i put special latin characters like ñ or tildes in a html file, this return 500 error. In another templates this dont happen, the codification is utf and all parameters looks fine, somebody have a idea how solve this? thanks a lot.
Hello @DanRows,
Just tested using a Windows machine. Unicode and UTF-8 characters are served correctly without a 500
error.
Please try this set up:
- Open
app/home/routes.py
- Comment the
except:
clause fromrender_template
method as shown below. This generic clause hides the exception text. - Re-test and reply with your error.
def route_template(template):
try:
if not template.endswith( '.html' ):
template += '.html'
# Detect the current page
segment = get_segment( request )
# Serve the file (if exists) from app/templates/FILE.html
return render_template( template, segment=segment )
except TemplateNotFound:
return render_template('page-404.html'), 404
#except: <-- Comment this line
# return render_template('page-500.html'), 500 <-- Comment this line
I have been looking for other ways to solve it avoiding commenting on that line, since using other of their templates with a similar configuration but in linux, I have not had this problem. I think the problem lies in the virtual environment that VS creates, from the requirements.txt file in Windows. I will mark it as resolved, thank you very much.
Please re-test using v1.0.5 release.