[Python-checkins] cpython (3.1): #9233: Fix json to work properly even when _json is not available.

ezio.melotti python-checkins at python.org
Wed Apr 13 06:21:51 CEST 2011


http://hg.python.org/cpython/rev/7019fc1a9663
changeset:   69317:7019fc1a9663
branch:      3.1
user:        Ezio Melotti
date:        Wed Apr 13 07:04:18 2011 +0300
summary:
  #9233: Fix json to work properly even when _json is not available.

files:
  Lib/json/decoder.py |  2 +-
  Lib/json/scanner.py |  1 +
  Misc/NEWS           |  6 ++++--
  3 files changed, 6 insertions(+), 3 deletions(-)


diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -214,7 +214,7 @@
         pairs = object_hook(pairs)
     return pairs, end
 
-def JSONArray(s_and_end, scan_once, context, _w=WHITESPACE.match):
+def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
     s, end = s_and_end
     values = []
     nextchar = s[end:end + 1]
diff --git a/Lib/json/scanner.py b/Lib/json/scanner.py
--- a/Lib/json/scanner.py
+++ b/Lib/json/scanner.py
@@ -22,6 +22,7 @@
     parse_int = context.parse_int
     parse_constant = context.parse_constant
     object_hook = context.object_hook
+    object_pairs_hook = context.object_pairs_hook
 
     def _scan_once(string, idx):
         try:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -51,9 +51,11 @@
 Library
 -------
 
-- Issue #11703 - urllib2.geturl() does not return correct url when the original
+- Issue #9233: Fix json to work properly even when _json is not available.
+
+- Issue #11703: urllib2.geturl() does not return correct url when the original
   url contains #fragment.
-  
+
 - Issue #10019: Fixed regression in json module where an indent of 0 stopped
   adding newlines and acted instead like 'None'.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list