Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17548 closed New feature (wontfix)

updated simplejson version

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

Description

It would be nice to have a bundled simplejson version that supports the use_decimal feature which has been added in version 2.1.0.

import simplejson as json
from decimal import Decimal
json.loads('1.1', use_decimal=True) == Decimal('1.1')

True

json.dumps(Decimal('1.1'), use_decimal=True) == '1.1'

True

Change History (3)

comment:1 by rm_, 13 years ago

example code:

>>> import simplejson as json
>>> from decimal import Decimal
>>> json.loads('1.1', use_decimal=True) == Decimal('1.1')
True
>>> json.dumps(Decimal('1.1'), use_decimal=True) == '1.1'
True

comment:2 by Ramiro Morales, 13 years ago

Resolution: wontfix
Status: newclosed

The copy of simplejson we bundle is for internal use in the (de)serializer code. We are well server by the version we currently include and we force use of decimal=False because it can introduce problems (see #16850, r17228 and r17229)

I'm going to wontfix this ticket because:

  1. I don't think users should be relying on specific versions of libraries we bundle, and
  2. Django shouldn't be the vehicle for users getting versions of these libraries newer than the ones available in the platform especially if its for uses outside of the ORM model serialziation/deserialziation functionality like calling .loads() and dumps() directly. It is out of scope and that's what tools like virtualenv and such are for.
Last edited 13 years ago by Ramiro Morales (previous) (diff)

comment:3 by Aymeric Augustin, 13 years ago

Also, note that we will remove the bundled copy after the 1.4 release, since Python >= 2.6 includes the "json" module.

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