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

Warning related to soft_unicode #164

Open
rsyring opened this issue Jun 7, 2021 · 0 comments
Open

Warning related to soft_unicode #164

rsyring opened this issue Jun 7, 2021 · 0 comments

Comments

@rsyring
Copy link
Member

rsyring commented Jun 7, 2021

DeprecationWarning: 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/rsyring/projects/keg-src/keg/tests/test_view_templating.py", line 11, in test_templating
    resp = self.testapp.get('/template1')
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/webtest/app.py", line 327, in get
    return self.do_request(req, status=status,
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask_webtest.py", line 224, in do_request
    response = super(TestApp, self).do_request(*args, **kwargs)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/webtest/app.py", line 623, in do_request
    res = req.get_response(app, catch_exc_info=True)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/webob/request.py", line 1309, in send
    status, headers, app_iter, exc_info = self.call_application(
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/webtest/lint.py", line 201, in lint_app
    iterator = application(environ, start_response_wrapper)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/werkzeug/local.py", line 375, in <lambda>
    __call__ = lambda x, *a, **kw: x._get_current_object()(*a, **kw)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/rsyring/projects/keg-src/keg/web.py", line 159, in dispatch_request
    response = self.render()
  File "/home/rsyring/projects/keg-src/keg/web.py", line 216, in render
    return flask.render_template(self.calc_template_name(), **self.template_args)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/templating.py", line 137, in render_template
    return _render(
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/rsyring/projects/keg-src/keg_apps/web/templates/templating/template1.html", line 7, in top-level template code
    {{ _('Hello %(name)s!') | format(name=name) }}
  File "/home/rsyring/projects/keg-src/.tox/py39-lowest/lib/python3.9/site-packages/jinja2/filters.py", line 823, in do_format
    return soft_unicode(value) % (kwargs or args)
SystemError: <built-in function soft_unicode> returned a result with an error set

Newer versions of Jinja clean this up, but the above comes from our "lowest" tests which use Flask<2.0 and related. Can clean this up when we stop supporting Flask 1.x.

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