[issue9233] json.load failure when C optimizations aren't built

Ezio Melotti report at bugs.python.org
Tue Apr 12 14:39:33 CEST 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

I ran the tests again on 2.7 and got 3 failures:

======================================================================
ERROR: test_c_scanstring (json.tests.test_scanstring.TestScanString)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wolf/dev/py/issue9233/Lib/json/tests/test_scanstring.py", line 13, in test_c_scanstring
    self._test_scanstring(json.decoder.c_scanstring)
  File "/home/wolf/dev/py/issue9233/Lib/json/tests/test_scanstring.py", line 17, in _test_scanstring
    scanstring('"z\\ud834\\udd20x"', 1, None, True),
TypeError: 'NoneType' object is not callable

======================================================================
FAIL: test_encode_basestring_ascii (json.tests.test_speedups.TestSpeedups)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wolf/dev/py/issue9233/Lib/json/tests/test_speedups.py", line 14, in test_encode_basestring_ascii
    self.assertEqual(encoder.encode_basestring_ascii.__module__, "_json")
AssertionError: 'json.encoder' != '_json'

======================================================================
FAIL: test_scanstring (json.tests.test_speedups.TestSpeedups)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wolf/dev/py/issue9233/Lib/json/tests/test_speedups.py", line 11, in test_scanstring
    self.assertTrue(decoder.scanstring is decoder.c_scanstring)
AssertionError: False is not true


The attached patch checks if _json is importable and skip the tests if it's not.

----------
Added file: http://bugs.python.org/file21628/issue9233.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9233>
_______________________________________


More information about the Python-bugs-list mailing list