unfortunately this just needs to be inlined, a separate utf8_z_hash
function won't work. the reason being that PyString_AsStringAndSize
gives access to the string object's internal buffer rather than copying,
and that string object was being decrefed away at the end of the
function, but the buffer we got out of it still needed to be usable.
When building a module from inside the git tree, the version
will also be "tagged" with the latest commit hash
Change-Id: Ic4b3d4072afcfccbb7bcbe09afc49f950d25e535
On 32-bit machines, a PyLong_AsLong() call on a 64-bit number will fail,
to remedy this we pull out the `long long` and use that to generate a buffer
to pass into yajl_gen_number() which will handle it appropriately
http://github.com/rtyler/py-yajl/issues#issue/16
Change-Id: Iec800f6e765e14041d7a264e3fdecdbb15cc986d
In the case of an OverflowError (see: issue #16), we want to raise *that*
exception instead of raising our own TypeError
Change-Id: I5b0cf5903b4cabe87df14137aa5d6c944ab3a270
Previously, py-yajl used `yajl_gen_number()` in order to print a non-escaped
buffer to the output stream. The ENSURE_NOT_KEY macro inside of yajl_gen.c
would cause entries to be dropped and an unchecked `yajl_gen_keys_must_be_strings`
status would be returned.
In order to work around this, a portion of code has been lifted from yajl_gen.c and
added to yajl_hacks.c which adds the function `yajl_gen_raw_string()` which prints
the buffer, unescaped, to the output stream without calling ENSURE_NOT_KEY.
http://github.com/rtyler/py-yajl/issues/#issue/12
Change-Id: I75a71573c4949d04ad4d532c27f2b64486db906e
Using yajl_gen_number() to circumvent yajl_gen_string()'s built-in
escaping and performing the conversion of wide-characters to their
respective code-points before passing the buffer along
Testing latin-1 and simplified chinese characters.
http://github.com/rtyler/py-yajl/issues#issue/7
Change-Id: I3a851aeff6548c7a3246be09515731abaae1fe93
Per issue #10, this is in line with the Python `json` module behavior:
>>> import json
>>> json.dumps({1:2})
'{"1": 2}'
>>> json.dumps({1.2:2})
'{"1.2": 2}'
Change-Id: Idd5c10e884227c5f82f19c6eabf083059f97950e
When calling `json.dumps` on a list of set() objects we should be raising
a TypeError. Resolving the issue wherein objects inside of lists in
`ProcessObject` that could not be encoded would be silently dropped.
Change-Id: I1022f8fa27b8290839a11fa22edba8d776a0f145
The `json` module in Python 2.6 functions in a similar fashion:
>>> json.dumps([(2,3,)])
'[[2, 3]]'
>>>
Reported by indigoviolet in issue #8
Change-Id: Ia5f0b649d137e42a692a38b52ccff71874dd4c71