[Django] #20560: django.utils.simplejson

13 views
Skip to first unread message

Django

unread,
Jun 4, 2013, 1:14:02 PM6/4/13
to django-...@googlegroups.com
#20560: django.utils.simplejson
--------------------------------------+--------------------
Reporter: aburgel | Owner: nobody
Type: Bug | Status: new
Component: Core (Serialization) | Version: 1.4
Severity: Normal | Keywords: json
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
The fix for #17071 introduces a NameError which gets swallowed. This
prevents django.utils.simplejson from using the builtin json library.

It tries to set the module's version to the version of the imported
library, like so:

`__version__ = json.__version__`

But it uses a `from json import *` instead of a `import json`, so you get
a NameError.

--
Ticket URL: <https://code.djangoproject.com/ticket/20560>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 4, 2013, 1:24:02 PM6/4/13
to django-...@googlegroups.com
#20560: django.utils.simplejson
-------------------------------------+-------------------------------------

Reporter: aburgel | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 1.4
(Serialization) | Resolution:
Severity: Normal | Triage Stage:
Keywords: json | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aburgel):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I've put the fix in a pull request:

https://github.com/django/django/pull/1243

The fix mirrors the approach taken for importing simplejson.

I have not included any tests because I'm not sure how such a test should
be written since its dependent on the underlying system. I'd be happy to
write one if someone could suggest a good way to do so.

--
Ticket URL: <https://code.djangoproject.com/ticket/20560#comment:1>

Django

unread,
Jun 4, 2013, 1:30:28 PM6/4/13
to django-...@googlegroups.com
#20560: django.utils.simplejson
-------------------------------------+-------------------------------------

Reporter: aburgel | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 1.4
(Serialization) | Resolution:
Severity: Normal | Triage Stage:
Keywords: json | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aburgel):

My bad. I didn't see #18022.

Clearly this is fixed in 1.5 and up. So please consider this bug report a
request to backport the fix to 1.4.

--
Ticket URL: <https://code.djangoproject.com/ticket/20560#comment:2>

Django

unread,
Jun 4, 2013, 1:40:11 PM6/4/13
to django-...@googlegroups.com
#20560: django.utils.simplejson
-------------------------------------+-------------------------------------
Reporter: aburgel | Owner: nobody
Type: Bug | Status: closed
Component: Core | Version: 1.4
(Serialization) | Resolution: duplicate

Severity: Normal | Triage Stage:
Keywords: json | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aburgel):

* status: new => closed
* resolution: => duplicate


Comment:

Nevermind. The fix is not necessary, #18022 says that the json library is
imported correctly.

--
Ticket URL: <https://code.djangoproject.com/ticket/20560#comment:3>

Reply all
Reply to author
Forward
0 new messages