pydata/pandas — pull request #1326 by Komnomnomnom (2012-05-28 13:09:26+00:00)
Title: Get JSON extension to work with Python 3 #1319

Python 3 fixes for ujson lib. All relevant tests pass (see below).

Tested on 64 bit OSX on Python 2.5, 2.6, 2.7, 3.1 & 3.2
Tested on 32 bit Ubuntu on Python 3.2

Apart from the define macros the handling for attribute / key names and the module initialisation code needed to be updated.

Some other notes:

1. I did not install scipy so the scipy tests failed but this should have no relevance for ujson
2. The `test_encodeBigEscape` in `test_ujson` seems to consume a lot of memory (or is more memory limited) in Python 3. It only passed in my Ubuntu VM when I upped its RAM to 2GB.
3. Several unicode tests now skipped for Python 2.6 (mostly the same as those skipped for 2.5). I didn't investigate this too much apart from checking that they failed with 2.6 for the original ujson library as well (they did).
4. `test_encodeListLongConversion` needs to pass `dtype=np.int64` to succeed for Python 3 on 32 bit. Under Python 3 numpy converts `int` to `np.int32` on 32 bit machines (whereas under Python 2 it's `long` -> `np.int64`).
5. I did not test on Windows :-/