Opened 9 years ago

Closed 9 years ago

#25468 closed New feature (fixed)

DjangoJSONEncoder should call unicode() on proxy strings.

Reported by: Stavros Korokithakis Owned by: nobody
Component: Core (Serialization) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Attachments (1)

25468.diff (2.0 KB ) - added by Claude Paroz 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Claude Paroz, 9 years ago

Component: UncategorizedCore (Serialization)
Triage Stage: UnreviewedAccepted
Type: BugNew feature
Version: 1.8master

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

by Claude Paroz, 9 years ago

Attachment: 25468.diff added

comment:2 by Claude Paroz, 9 years ago

Has patch: set

comment:3 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In b7ade64:

Fixed #25468 -- Made DjangoJSONEncoder lazy string aware

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

Note: See TracTickets for help on using tickets.
Back to Top