#13526: JSONDecoder raise AttributeError with simplejson 2.1.1
----------------------------+-----------------------------------------------
 Reporter:  oxys            |       Owner:  nobody    
   Status:  new             |   Milestone:            
Component:  Core framework  |     Version:  SVN       
 Keywords:                  |       Stage:  Unreviewed
Has_patch:  0               |  
----------------------------+-----------------------------------------------
 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
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to