Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Fix deprecated simplejson module in django 1.5 #22

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment
Open

Fix deprecated simplejson module in django 1.5 #22

GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Django 1.5 has deprecated simplejson module. There is a backward 
incompatibility among simplejson versions. Specifically, namedtuple_as_object 
is a keyword argument to simplejson.JSONEncoder that was added in simplejson 
2.2. The latest version of simplejson that was merged into the python standard 
library is 2.0.9 and Django 1.4 shipped with simplejson 2.0.7 bundled. This 
means that nowhere in stock Django are there any references to this keyword. 
This wouldn't be a huge problem, except that Django subclasses 
django.utils.simplejson.JSONEncoder as 
django.core.serializers.json.DjangoJSONEncoder, and naturally doesn't know 
about this keyword argument.

Please see <a 
href="https://code.djangoproject.com/ticket/18023#comment:10">here</a> for more 
details.

To fix this problem, simply use json instead of simplejson. However, 
wadofstuff-django-serializers name the serializer module json.py, so the file 
can't import the system json and import itself instead. The module name, 
therefore, needs to be changed. Following that train of thoughts, attached 
please find a patch for /wadofstuff/django/serializers/json.py

Thank you.

Original issue reported on code.google.com by [email protected] on 18 Mar 2013 at 10:37

Attachments:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant