8000 Support unicode in journal · Issue #1 · lipidity/ledgible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support unicode in journal #1
Open
@clehner

Description

@clehner

When I load pages I get a 500 Internal Server Error. I added some logging and see stack traces like the following:

Exception on /balance [GET]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/srv/http/ledgible/ledgible.py", line 214, in balance
    return render_template('balance.html', rows=rows, encoding='utf-8')
  File "/usr/lib/python2.7/dist-packages/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/usr/lib/python2.7/dist-packages/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "templates/balance.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "templates/base.html", line 23, in top-level template code
    {% block content %}{% endblock %}
  File "templates/balance.html", line 18, in block "content"
    {{ (total.strip_annotations()|string).splitlines() | join('<br>'|safe) }}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 263: ordinal not in range(128)

The error went away when I used a journal that didn't have unicode characters in it (e.g., currency symbols)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0