[Django] #25468: DjangoJSONEncoder should call unicode() on proxy strings.

36 views
Skip to first unread message

Django

unread,
Sep 25, 2015, 8:22:24 PM9/25/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
-------------------------------+--------------------
Reporter: skorokithakis | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
If one uses the translation framework to get a string to convert to JSON,
the DjangoJSONEncoder will choke on it, as it won't try to reify it. It
should check the object type and call unicode() on proxy objects instead.

--
Ticket URL: <https://code.djangoproject.com/ticket/25468>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 26, 2015, 9:07:19 AM9/26/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
--------------------------------------+------------------------------------
Reporter: skorokithakis | Owner: nobody
Type: New feature | Status: new
Component: Core (Serialization) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* component: Uncategorized => Core (Serialization)
* needs_tests: => 0
* version: 1.8 => master
* needs_docs: => 0
* type: Bug => New feature
* stage: Unreviewed => Accepted


Comment:

I have a local patch ready to fix that, waiting on
https://github.com/django/django/pull/5365 to be merged first.

--
Ticket URL: <https://code.djangoproject.com/ticket/25468#comment:1>

Django

unread,
Sep 26, 2015, 9:11:33 AM9/26/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
--------------------------------------+------------------------------------
Reporter: skorokithakis | Owner: nobody

Type: New feature | Status: new
Component: Core (Serialization) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* Attachment "25468.diff" added.

Django

unread,
Sep 26, 2015, 2:18:16 PM9/26/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
--------------------------------------+------------------------------------
Reporter: skorokithakis | Owner: nobody

Type: New feature | Status: new
Component: Core (Serialization) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/25468#comment:2>

Django

unread,
Sep 26, 2015, 3:36:13 PM9/26/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
-------------------------------------+-------------------------------------
Reporter: skorokithakis | Owner: nobody

Type: New feature | Status: new
Component: Core | Version: master
(Serialization) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25468#comment:3>

Django

unread,
Sep 27, 2015, 4:38:25 PM9/27/15
to django-...@googlegroups.com
#25468: DjangoJSONEncoder should call unicode() on proxy strings.
-------------------------------------+-------------------------------------
Reporter: skorokithakis | Owner: nobody
Type: New feature | Status: closed

Component: Core | Version: master
(Serialization) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"b7ade645290ecf45530fe7211f8f759fc9cf9971" b7ade64]:
{{{
#!CommitTicketReference repository=""
revision="b7ade645290ecf45530fe7211f8f759fc9cf9971"
Fixed #25468 -- Made DjangoJSONEncoder lazy string aware

Thanks Stavros Korokithakis for the report and Tim Graham for the
review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25468#comment:4>

Reply all
Reply to author
Forward
0 new messages