{{{
<input type="hidden" name="csrfmiddlewaretoken"
value="<django.utils.functional.__proxy__ object at 0x1c7>">
}}}
I attached a patch that fixes this bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:1>
* cc: apollo13 (added)
Comment:
Is that only an issue on jython or on python too?
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:2>
Comment (by andreas@…):
As far as I can see, it is only an issue on jython. I guess there is a
difference in the behaviour of the string.format method. However, '%s'
place holders are working fine with lazy string objects.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:3>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
We should review carefully what the expected type and what the actual type
are (str or unicode?), and make sure this is the correct level to fix the
problem. If we're indeed relying on an implicit cast, and that trips up
Jython, we should make it explicit. (str is unicode-based on Jython and
that could explain the problem.)
I would also like to see a test that fails on CPython; without such a test
we could easily reintroduce this problem in the future.
Minor comment on the patch: `args_safe` should use a list comprehension
rather than map/lambda.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:4>
Comment (by andreas@…):
I attached a new version of the patch that is using a list comprehension
instead of a map+lambda expression. Unfortunately I was not able to write
a test that reproduces the Jython behaviour on CPython.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:5>
Comment (by andreas@…):
I was able to fix the problem on a lower level, by assigning the {{{
__text_cast }}} method not only on the {{{ __unicode__ }}} method of the
Promise class, but also on the {{{ __str__ }}} method. But I am not sure
if that is the right thing to do.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:6>
Comment (by bmispelon):
This looks like it might be related to #20221.
Can you try applying the patch I made for it [1] and telling me if the
problem is still there?
Thanks.
[1] https://github.com/django/django/pull/1007
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:7>
* cc: bmispelon@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:8>
Comment (by andreas@…):
Unfortunately your patch does not solve the problem with jython.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:9>
* status: new => closed
* resolution: => needsinfo
Comment:
[https://pythonhosted.org/django-jython/ django-jython] has been updated
to work with Django 1.7. I'd think we would have heard about this issue if
it were still a problem. Please reopen with more details if it can still
be reproduced.
--
Ticket URL: <https://code.djangoproject.com/ticket/20017#comment:10>