Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#17548 closed New feature (wontfix)

updated simplejson version

Reported by: rm_ Owned by: nobody
Component: Core (Serialization) Version: master
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 Changed 4 years ago by rm_

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 4 years ago by ramiro

  • Resolution set to wontfix
  • Status changed from new to closed

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 4 years ago by ramiro (previous) (diff)

comment:3 Changed 4 years ago by aaugustin

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