Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#18022 closed Bug (fixed)

Django 1.4 never uses python's standard json module

Reported by: Alex Ogier Owned by: nobody
Component: Core (Serialization) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The problem is that an overly zealous except clause masks a NameError that always gets raised.

Attachments (1)

import_json.diff (456 bytes ) - added by Alex Ogier 13 years ago.

Download all attachments as: .zip

Change History (5)

by Alex Ogier, 13 years ago

Attachment: import_json.diff added

comment:1 by Claude Paroz, 13 years ago

Triage Stage: UnreviewedAccepted

Just waiting confirmation by another core dev before committing in 1.4.X branch.

comment:2 by Alex Ogier, 13 years ago

I may have been mistaken. The __version__ = json.__version__ line definitely used to cause a NameError and there's no way __version__ was set successfully, but that doesn't happen until after everything from json is loaded and use_system_version is set. It looks like __version__ never gets set, and the fix in #17018 never accomplished anything, but you do end up getting the rest of standard library json as expected.

Still worth merging to get the correct __version__ but it's not particularly critical.

comment:3 by Ramiro Morales, 13 years ago

Resolution: fixed
Status: newclosed

In [17865]:

Fixed #18022 -- Fixed import of standalone Python 'json' module.

Thanks Clueless for the report and initial patch.

Refs #17071, r17018.

comment:4 by Claude Paroz, 13 years ago

IMHO, this fix is useful mainly for the 1.4.X branch, as in 1.5 this will probably get a much more serious refactoring (#18023).

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