simplejson/simplejson — Issue #27: simplejson 2.3.1: simplejson.tests.test_namedtuple.TestNamedTuple.test_namedtuple_dumps() fails when simplejson/_speedups.so extension module is present
Author: Arfrever
Created: 2011-12-29 23:21:33+00:00
State: open

If _speedups.so extension has been built, then test_namedtuple_dumps fails and a segmentation fault can also occur. This regression has been introduced in simplejson 2.3.1.

```
$ python2.7 setup.py build_ext -i
...
$ python2.7 simplejson/tests/__init__.py
..........................................................................F...................................................................................
======================================================================
FAIL: test_namedtuple_dumps (simplejson.tests.test_namedtuple.TestNamedTuple)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/simplejson-2.3.1/simplejson/tests/test_namedtuple.py", line 54, in test_namedtuple_dumps
self.assertEqual(d, json.loads(json.dumps(v)))
AssertionError: OrderedDict([('value', 1)]) != [1]

----------------------------------------------------------------------
Ran 158 tests in 2.785s

FAILED (failures=1)
$ python2.7 simplejson/tests/__init__.py
..........................................................................F........................................................................Segmentation fault
```

Deletion of *.pyc files avoids segmentation fault.