#29617: Regression - lazy strings are raising TypeError in template Lexer
-------------------------------------+-------------------------------------
Reporter: Dražen | Owner: Dražen Odobašić
Odobašić |
Type: Bug | Status: assigned
Component: Template | Version: master
system |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
* in Django 1.11 we were using `force_text` when initializing templates
and that evaluated any lazy objects -
https://github.com/django/django/commit/3a148f958dddd97c1379081118c30fbede6b6bc4
#diff-8cbe1fb6d589cb6e35b956704d7a1285L154
* in this context lazy objects are usually `gettext` wrapped strings
* in Django 2.0/master we removed `force_text` so lazy strings are no
longer evaluated, and that raises a `TypeError: expected string or bytes-
like object` -
https://github.com/django/django/blob/2.0.7/django/template/base.py#L349
* proposed solution: use `str` to force evaluation of lazy objects
--
Ticket URL: <https://code.djangoproject.com/ticket/29617>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.d0201ecc8d18b370d022753b7a64cae5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.