1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-05-14 20:56:23 +02:00
Commit Graph

44 Commits

Author SHA1 Message Date
Hugo van Kemenade f2d79b89c4 Remove unused variable 2021-04-07 10:23:26 +03:00
Sam Sneddon f4029cc6ef Fix #429: Make empty dict/list indented serialization match stdlib json
Previously, we'd output a couple of new lines between the start and end
of the object, whereas the stdlib doesn't bother with whitespace if
they're empty.

In my testing, the only difference in indented serialization now is
float representation.
2020-11-10 10:57:15 +00:00
Hugo 5f1e8479fa Lint trailing-whitespace 2020-05-12 09:21:45 +03:00
Hugo d53480c332 http -> https 2020-02-18 21:57:13 +02: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 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
Orivej Desh 11b0d2db25 Indent dict values 2016-04-03 16:30:43 +00: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
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
Georgy Kibardin 457cda771d escape_forward_slashes now only ignores forward slashes, not everything else 2015-09-08 15:54:13 +03:00
Chris Huang 930dfa5525 Support for space indent for JSON encoding 2015-04-09 12:30:46 +02:00
Tim Dawborn 921716a3b7 Initial support for sort_keys parameter for JSON encoding. 2015-04-08 20:42:56 +02:00
Mathieu Leplatre d169b7ccbc Add option to disable forward slash escape
Ref issue #144
2015-03-31 23:41:51 +02:00
Mitar a8f0f0f101 If an object has a __json__ method, use it when encoding.
It should return a raw JSON string which will be directly included in
the resulting JSON when encoding.
2014-12-29 10:13:46 +01:00
Joakim Hamrén c9744834ab Merge pull request #142 from kevinbirch/support_unsigned_long_numerics
Support values between [0, 2^64 - 1]
2014-11-14 00:33:20 +01:00
kevin birch cbd68782c8 add encoding support for unsigned long long 2014-11-11 18:25:27 -05:00
Joakim Hamren 7d28dc09ec Fixed segfault on invalid unicode char on python 3 2014-10-28 23:32:14 +01:00
Jonas Tarnstrom 0d76bd0849 Revert "Minor performance optimization"
This reverts commit 510a8fc6d7.
2014-04-16 08:42:48 +02:00
Jonas Tarnstrom 510a8fc6d7 Minor performance optimization 2014-04-14 15:52:22 +02:00
Jonas Tarnstrom 4057771d9c Added private argument support for encoder path 2014-04-14 14:43:15 +02:00
Jonas Tarnstrom 9f3449b826 Updated copyright clause 2014-04-14 13:45:50 +02:00
Jonas Tarnstrom 06173a7354 Improved generic iterator support, revmoed iterBegin from encoder API, added test for blist 2014-04-14 13:39:03 +02:00
smartsgy 9de9190859 Fix minGW sprintf_s build error
On windows, We should replace snprintf on msvc only.
2013-09-01 22:54:57 +08:00
Jonas Tarnstrom 08ff81a21d Added explanation text 2013-06-11 08:10:34 +02:00
Jonas Tarnstrom 4e4dc5e4cc Added 2 bytes to the string reservation macro to guaranteed to able to hold the quotes 2013-06-11 08:09:57 +02:00
Jonas Tarnstrom 79ac0e971d Fixed potential overflow issue with the estimations of string buffer lengths 2013-06-10 12:14:09 +02:00
Mikhail Sychev e098bd1ce9 Fixed style of .c and .h files to use 2 spaces instead of 4 spaces and tabs and added some braces for easier code reading. 2013-05-08 13:52:53 -07:00
jtarnstrom fd6cc28ab9 Added support for python decimal. Forward ported encode_html_chars patch. Made it all into one big nice commit 2013-02-12 17:15:42 +01:00
unknown a2e9adb885 Updated license preamble 2013-01-16 16:22:08 +01:00
Jonas Tarnstrom a1747b95c6 Fixed all compilers warnings on Level4 MSVC++ 2012-11-13 17:14:09 +01:00
Jonas Tarnstrom a6af1d09c6 Updated license to 3-clause BSD 2012-06-25 11:29:54 +02:00
Kieran O'Mahony 6901f41a7c memory alignment fixes
Avoids segmentation faults on strict architectures e.g. SPARC
2012-06-12 12:05:00 +01:00
Kieran O'Mahony c4016cfcda don't compare pointers outside their allocated regions (fixes segmentation faults) 2012-06-12 12:05:00 +01:00
Kieran O'Mahony 3998aa86eb check if malloc succeeds to avoid segmentation faults when ujson runs out of memory 2012-06-12 12:04:59 +01:00
Kieran O'Mahony fda0329ca9 msvc build fixes 2012-06-12 12:04:59 +01:00
Kieran O'Mahony a1fd2a582a increased double precision 2012-06-12 12:04:59 +01:00
Kieran O'Mahony 79e980641d fix compiler warnings
& remove redundant enum
2012-06-12 12:04:59 +01:00
Kieran O'Mahony d041aba16a tabs -> spaces, convert newlines 2012-06-12 12:04:59 +01:00
unknown 83f1ee99f7 Restructured code for better pypi packaging 2012-02-07 17:11:29 +01:00