﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13526	JSONDecoder raise AttributeError with simplejson 2.1.1	oxys	nobody	"To reproduce, setup simplejson 2.1.1
{{{
$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
>>> from django.utils.simplejson.decoder import JSONDecoder
>>> JSONDecoder()
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/Users/me/Code/Django/django_trunk/django/utils/simplejson/decoder.py"", line 319, in __init__
    self.scan_once = make_scanner(self)
AttributeError: 'JSONDecoder' object has no attribute 'object_pairs_hook'
}}}

Patch :

{{{
Index: django/utils/simplejson/scanner.py
===================================================================
--- django/utils/simplejson/scanner.py  (revision 13238)
+++ django/utils/simplejson/scanner.py  (working copy)
@@ -3,6 +3,10 @@
 import re
 try:
     from simplejson._speedups import make_scanner as c_make_scanner
+    from simplejson import __version__ as speedups_version
+    from . import __version__
+    if speedups_version != __version__:
+        c_make_scanner = None
 except ImportError:
     c_make_scanner = None
}}}"		closed	Core (Other)	dev		invalid			Unreviewed	0	0	0	0	0	0
