1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-06-03 15:46:05 +02:00
Commit Graph

547 Commits

Author SHA1 Message Date
Hugo a3eeb7b3cf Cache pip 2020-02-18 22:14:17 +02:00
Hugo 8f7839f48b sudo no longer needed https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration 2020-02-18 22:13:58 +02:00
Hugo van Kemenade 4872eb6c5b
Merge branch 'master' into rm-eol 2020-02-18 22:05:46 +02:00
Hugo d53480c332 http -> https 2020-02-18 21:57:13 +02:00
Hugo 98caabf575 Test on GitHub Actions 2020-02-18 21:44:21 +02:00
Krisztián Szűcs 9722b1aa11 include license file in manifest 2020-02-18 20:01:47 +01:00
Drew H 2914376bc5 Remove redundant license parameter 2020-02-18 19:57:36 +01:00
Hugo c377040a53 Test on Python 3.9-dev to avoid surprises 2020-02-18 19:54:54 +01:00
Hugo 450b86d8c3 Add support for Python 3.7 and 3.8 2020-02-14 21:00:55 +02:00
Hugo 86879e0c2b Drop support for EOL Python 3.4 2020-02-14 20:59:47 +02:00
Mark Guzman fe0e88d345
adding an allow_nan keyword argument to dumps defaulted to True
with this ujson matches the builtin json behavior for NaN and Inf.
if a user wants to retain the old behavior they can pass allow_nan=False
to ensure strict json compatibility.
2019-02-20 09:50:05 -05:00
Tim Dawborn 948807cfe5
Correct JSON decoding implementation to die on trailing commas in Objects. Fixes esnme/ultrajson#50. 2018-12-10 18:01:40 +11:00
Hugo 5a11e9d95b Upgrade Python syntax with pyupgrade 2018-07-25 11:27:06 +03:00
Hugo 054c0b7a34 Drop EOL Python 2.5, 2.6, 3.2 and 3.3 2017-12-26 13:46:44 +02:00
Hugo 16138e97b4 Add PyPI badges 2017-12-26 13:45:57 +02:00
Hugo 9faac616a5 Add Python 3.6 2017-12-26 00:48:27 +02:00
Eric Le Lay b9c7fffca9 help branch prediction
was seing  ~5% drop in performance without it on 250 strings
2017-06-11 20:30:39 +02:00
Eric Le Lay ad280fd99e new reject_bytes option to raise on bytes
raise TypeError when encountering bytes in ujson.dumps() to prevent
unexpected Unicode exceptions in production.
Fixes #264
2017-06-11 11:58:10 +02:00
Joakim Hamrén 7d0f4fb7e9 Merge pull request #260 from markpiekarz/patch-1
Update ultrajsondec.c
2017-03-29 13:56:11 +02:00
markpiekarz 629128de5e Update ultrajsondec.c
Explicitly include stdint.h to define SIZE_MAX.
2017-03-29 17:02:31 +11:00
Mikhail Borisov 4481b8d53b Do not discard result of PyObject_CallObject()
PyObject_CallObject() returns a PyObject*; discarding it leaked
memory for the result of output.write().
2017-03-23 10:20:09 +03:00
Mikhail Borisov bc94d64fba Release saved raw JSON string.
Using ujson.dumps() with objects having __json__() method leaked memory
for object's JSON representation.
2017-03-23 10:19:06 +03:00
Joakim Hamrén f1b108585c Merge pull request #255 from adamchainz/patch-1
Add syntax highlighting to README
2017-03-14 12:35:55 +01:00
Adam Johnson ba4a0dc530 Add syntax highlighting to README 2017-03-12 22:59:06 +00:00
Joakim Hamren eb7d894f22 Integrated google's double-conversion lib
To fix issues with floating-point precision we've made use of Google's
double-conversion lib to handle conversions of doubles to and from strings.

In addition to fixing our precision problems this will improve double
encoding by 4-5x. Decoding is however slightly slower according to the
benchmarks - but accurate at least.

This change removes the double_precision encoding option and the
precise_float decoding option.
2017-02-14 12:20:04 +01:00
Joakim Hamren 2f1d4874f4 Skip OrderedDict test for < 2.7 2017-02-07 02:10:08 +01:00
Joakim Hamren c9f8318bd8 Fix for incorrect order when using OrderedDict 2017-02-07 02:02:38 +01:00
Joakim Hamren 3a6ba52366 Removed blist tests 2017-02-07 00:02:20 +01:00
Joakim Hamren 7b5dc3172d New major version because of breaking changes 2017-02-06 23:45:38 +01:00
Joakim Hamren 50181f060f Removed serialization of date/datetime objects
To better align with the standard json module this removes ujson
default serialization of date/datetime objects to unix-timestamps.

Trying to serialize such an object will now raise a TypeError "repr(obj)
is not JSON serializable".
2017-02-06 23:27:29 +01:00
Joakim Hamren 5f98f01095 Removed support for __json__ method on str
This functionality caused a performance regression without a use-case
justifying the trade-off.
2017-02-06 23:27:29 +01:00
Joakim Hamren 53f85b1bd6 Removed generic serialization of objects/iterables
The behavior of ujson has always been to try to serialize all objects in
any way possible. This has been quite a deviation from other json
libraries, including Pythons standard json module, and the source of a
lot of confusion and bugs. Removing this quirk moves ultrajson closer to
the expected behavior.

Instead of trying to coerce serialization ultrajson will now throw a
TypeError: "repr(obj) is not JSON serializable" exception.
2017-02-06 23:27:25 +01:00
Joakim Hamren ac4637fbc4 Following std json handling of None dict key
Previously a None dict item key would be outputted in JSON as "None".
To better align with the standard json module this was changed to output
"null". There's no proper representation of null object keys in JSON so
this is implementation specific but it seems more natural to follow
suit when it can be done without a significant performance hit.

Added and used branch prediction macros (LIKELY/UNLIKELY) as well.
2017-02-04 16:36:14 +01:00
Joakim Hamren 409c6d4006 Fix for overflowing long causing invalid json
This was caused by checking for "__json__" using PyObject_HasAttrString
which clears the error set by a previous long overflow. Thus this was dependent
on the order of processing of dict items, which explains why it was
seemingly random as the dict items are likely ordered by a hash of
the key.

This fixes GH224 and GH240.
2017-02-04 04:21:05 +01:00
Joakim Hamren 870ee48fe1 Fixes for sort_keys bug and a typo.
- Fixed segfault when using sort_keys=True on dict with unorderable keys (GH247)

    - Fixed refcount becoming negative when using sort_keys=True (GH243)

    - Fixed compile error when defining JSON_NO_EXTRA_WHITESPACE
      caused by a wrongly named variable. (GH245)
2017-02-04 01:07:52 +01:00
Joakim Hamrén ab6b6f88cd Merge pull request #217 from orivej/indent-dict-values
Indent dict values
2016-10-10 22:25:22 +02:00
Joakim Hamrén d25e024f48 Merge pull request #238 from WGH-/static-functions
added "static" to C functions, where possible
2016-10-10 22:06:20 +02:00
Joakim Hamren 6a0d07a7df Indentation fixes and other style fixes 2016-10-10 21:50:57 +02:00
WGH 6cf6c7ff25 added "static" to C functions, where possible
1. It reduces clutter in symbol table.
2. It fixes issues with C99 inline semantics for functions
   marked as inline (#237, #180, #222), which manifests
   when compiled with GCC>=5.
2016-08-27 17:34:22 +03:00
Joakim Hamrén 42044fef11 Merge pull request #234 from rdpate/patch-1
bring back benchmark introduction
2016-08-21 02:48:36 +02:00
Roger Pate bc010b58b9 bring back benchmark introduction 2016-08-20 15:42:17 -04:00
Orivej Desh 11b0d2db25 Indent dict values 2016-04-03 16:30:43 +00:00
Joakim Hamrén af5ca77263 Merge pull request #207 from anthraxx/master
do not forcefully remove the build directory manually (fix #179)
2016-01-26 15:30:35 +01:00
anthraxx 3943517711 do not forcefully remove the build directory manually
this fixes issue #179.
setuptools should itself know when to use cache or create a
new build... however if someone wants to override that, it's
still possible but forcefully doing that on whatever
setuptools target will (and does) introduce problems.

Build directory should be cleaned up via the clean sub-command.
examples:
- clean up temp:
  python setup.py clean
- clean up whole build dir
  python setup.py clean -a

Or if somebody wants to, the build dir could be removed on the
shell.
2016-01-26 14:34:08 +01:00
Joakim Hamren 3723f573d3 Reverting usage of python setup.py test 2016-01-20 09:10:48 +01:00
Joakim Hamren e3ca6c5f43 Fixed assertRegex error on python 2 and checking if nose2.collector works with python 2.6 2016-01-18 07:44:55 +01:00
Joakim Hamren 7079f3c709 Added unittest2 to setup.py tests_require 2016-01-18 06:51:46 +01:00
Joakim Hamren 52bc13b6fc Bumping version to 1.35 2016-01-18 06:49:26 +01:00
Joakim Hamren 23f092438e Added test package requirements to setup.py 2016-01-18 06:45:34 +01:00
Joakim Hamren 1c217339ba Merge branch 'ngandhy-master' 2016-01-18 06:39:22 +01:00