* 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.
* has_patch: 0 => 1
* severity: Normal => Release blocker
* version: master => 2.0
* stage: Unreviewed => Ready for checkin
Comment:
[https://github.com/django/django/pull/10247 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29617#comment:1>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9f3b9ffd51c71d96728df9ee16f5a57c6f3b315d" 9f3b9ff]:
{{{
#!CommitTicketReference repository=""
revision="9f3b9ffd51c71d96728df9ee16f5a57c6f3b315d"
Fixed #29617 -- Fixed Template crash if template_string is lazy.
Regression in 3a148f958dddd97c1379081118c30fbede6b6bc4.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29617#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4dadf4eb7bad7c8e9154ff86e7e42ed846c8974d" 4dadf4e]:
{{{
#!CommitTicketReference repository=""
revision="4dadf4eb7bad7c8e9154ff86e7e42ed846c8974d"
[2.1.x] Fixed #29617 -- Fixed Template crash if template_string is lazy.
Regression in 3a148f958dddd97c1379081118c30fbede6b6bc4.
Backport of 9f3b9ffd51c71d96728df9ee16f5a57c6f3b315d from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29617#comment:3>
Comment (by Tim Graham <timograham@…>):
In [changeset:"253f1b74daac6300f6670929bfc0540ce1e71f7a" 253f1b74]:
{{{
#!CommitTicketReference repository=""
revision="253f1b74daac6300f6670929bfc0540ce1e71f7a"
[2.0.x] Fixed #29617 -- Fixed Template crash if template_string is lazy.
Regression in 3a148f958dddd97c1379081118c30fbede6b6bc4.
Backport of 9f3b9ffd51c71d96728df9ee16f5a57c6f3b315d from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29617#comment:4>
Comment (by Daniel Miller):
It appears that as of
[https://github.com/django/django/commit/4dadf4eb7bad7c8e9154ff86e7e42ed846c8974d
this change] it is no longer possible to use `Template` with bytes since
the input is now coerced to `str`. [https://github.com/dimagi/commcare-
hq/pull/27911/commits/897b3ff56cdef6179f1d4373f34b15d9d5411fec CommCareHQ
was using that feature] and ran into the issue while upgrading Django. I
did not see mention of this backward-incompatible change in the release
notes.
--
Ticket URL: <https://code.djangoproject.com/ticket/29617#comment:5>