mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
#11982: fix json.loads('""') to return u'' rather than ''.
This commit is contained in:
parent
1602ec109b
commit
df8a8f768d
3 changed files with 5 additions and 2 deletions
|
@ -26,7 +26,8 @@ class TestDecode(TestCase):
|
||||||
def test_empty_objects(self):
|
def test_empty_objects(self):
|
||||||
self.assertEqual(json.loads('{}'), {})
|
self.assertEqual(json.loads('{}'), {})
|
||||||
self.assertEqual(json.loads('[]'), [])
|
self.assertEqual(json.loads('[]'), [])
|
||||||
self.assertEqual(json.loads('""'), "")
|
self.assertEqual(json.loads('""'), u"")
|
||||||
|
self.assertIsInstance(json.loads('""'), unicode)
|
||||||
|
|
||||||
def test_object_pairs_hook(self):
|
def test_object_pairs_hook(self):
|
||||||
s = '{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}'
|
s = '{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}'
|
||||||
|
|
|
@ -77,6 +77,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #11982: fix json.loads('""') to return u'' rather than ''.
|
||||||
|
|
||||||
- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
|
- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
|
||||||
around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
|
around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
|
||||||
|
|
||||||
|
|
|
@ -595,7 +595,7 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict, Py_s
|
||||||
Py_DECREF(chunk);
|
Py_DECREF(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
rval = join_list_string(chunks);
|
rval = join_list_unicode(chunks);
|
||||||
if (rval == NULL) {
|
if (rval == NULL) {
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue