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

Fix deprecated simplejson module in django 1.5 #22

Description

@GoogleCodeExporter
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 limda...@gmail.com on 18 Mar 2013 at 10:37

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions