1
0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-09-20 19:32:05 +02:00
Commit Graph

333 Commits

Author SHA1 Message Date
Hugo
59c3d0e51e Cache pip 2020-02-21 11:37:31 +02:00
Hugo
be90da9ab7 sudo no longer needed https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration 2020-02-21 11:37:18 +02:00
Hugo
5b681810fc Test other CPU architectures 2020-02-21 11:36:25 +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
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
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
Joakim Hamren
4da6667044 Merge branch 'master' of https://github.com/ngandhy/ultrajson into ngandhy-master
Conflicts:
	tests/tests.py
2016-01-18 06:38:34 +01:00
Joakim Hamren
74ee682f98 Merge branch 'timdawborn-correct_unit_tests_and_benchmarks' 2016-01-18 06:26:06 +01:00
Joakim Hamren
7314538933 Removed commented out code from merge 2016-01-18 06:24:11 +01:00
Joakim Hamren
01cb24910e Merge branch 'correct_unit_tests_and_benchmarks' of https://github.com/timdawborn/ultrajson into timdawborn-correct_unit_tests_and_benchmarks
Conflicts:
	tests/tests.py
2016-01-18 06:20:14 +01:00
Joakim Hamrén
86bb8ffd10 Merge pull request #157 from wlanslovenija/raw-json
If an object has a __json__ method, use it when encoding
2016-01-15 05:06:19 +01:00
Joakim Hamrén
07507b7898 Merge pull request #191 from joshkel/master
Update tests for floating point inaccuracies
2016-01-15 04:13:02 +01:00
Joakim Hamrén
8c0edfb149 Merge pull request #203 from timdawborn/sort_keys_memory_leak
Corrected memory leak in sort_keys=True
2016-01-15 04:05:46 +01:00
Joakim Hamrén
2033cfc0bc Merge pull request #136 from b4hand/fix-typo
Fix typo.
2016-01-15 03:59:01 +01:00
Joakim Hamrén
f35e664e5c Merge pull request #195 from aebrahim/patch-1
Test on python 3.5 on travis
2016-01-15 03:51:05 +01:00
Joakim Hamrén
06fe4c68f0 Merge pull request #186 from shashurup/master
escape_forward_slashes now only ignores forward slashes, not everythi…
2016-01-15 03:50:42 +01:00
Tim Dawborn
4c5c0612f7 Updated benchmark results, and added results for both Python 2 and
Python 3. Fixes #154.
2015-12-29 14:26:00 +11:00
Tim Dawborn
04428508d6 * Refactored the unit testing and benchmarking code to work natively under
both Python 2 and Python 3, removing the need for 2to3 to be run. This
  indirectly fixes #177.
* Corrected a duplicate-named method in the unit testing code. Corrected the
  now-exposed broken logic that wasn't being tested. This was
  highlighted in #186 but the author did not appear to realise that the
  method name was being masked in the unit test class.
* Corrected the test case skipping logic to use unittest.skipIf instead
  of just returning from the method upon an ImportError so that the skip
  can actually be registered as a skipped test instead of a passed test.
* Updated the tests to additionally run on Python 3.5 on Travis. This
  covers #195.
* Merged the two benchmarking files into one, and modularised the code.
  Also added native RST output so the benchmarking results can be placed
  directly into the README file.
2015-12-29 14:23:23 +11:00
Tim Dawborn
4c4624a7f8 Corrected memory leak due to not decrementing the reference count of the
list item being replaced.
2015-12-28 15:46:27 +11:00
Ali Ebrahim
97887fe73e Test on python 3.5 on travis 2015-12-01 11:30:03 -08:00