1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-05-28 22:26:01 +02:00
Commit Graph

137 Commits

Author SHA1 Message Date
joncrall e8fc9e1190
Add proper default to disable 2022-04-25 14:08:03 -04:00
joncrall 3d25fb4fe6
remove skip-lib-comps command 2022-04-22 18:57:46 -04:00
joncrall 991bf12059
Merge branch 'benchmark-flexibility' of github.com:Erotemic/ultrajson into benchmark-flexibility 2022-04-21 17:34:06 -04:00
joncrall 3850b93182
Remove cpuinfo 2022-04-21 17:33:51 -04:00
pre-commit-ci[bot] 3eb7a19f60 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-21 21:13:27 +00:00
joncrall eb71ee87c5
Merge branch 'benchmark-flexibility' of github.com:Erotemic/ultrajson into benchmark-flexibility 2022-04-21 16:59:41 -04:00
pre-commit-ci[bot] 79a6122e5f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-21 20:59:32 +00:00
joncrall 78f24e290e
Add note about units of benchmarks 2022-04-21 16:57:05 -04:00
joncrall 32de298ee7
Added argparse CLI with ability to disable specific modules 2022-04-21 16:39:34 -04:00
joncrall ccd30400b0
Generalize the way new json modules can be added to existing benchmarks 2022-04-21 16:16:22 -04:00
JustAnotherArchivist b3f8754c8a Fix segmentation faults when handling unserialisable objects
Errors during `__repr__` itself as well as ones during the conversion to a bytes object were not handled, resulting in NULL pointer dereferencing.

Cf. #382
2022-04-18 12:20:18 +01:00
Hugo van Kemenade 779949896e
Merge pull request #526 from JustAnotherArchivist/fix-obj-str-exception-segv
Fix segmentation fault when an exception is raised while converting a dict key to a string
2022-04-14 07:00:55 +03:00
Hugo van Kemenade b8a85c8488
Merge pull request #527 from JustAnotherArchivist/fuzz-ref-count
Add ref count checks to fuzz tests
2022-04-13 21:55:22 +03:00
JustAnotherArchivist 97fceb6245 Add test for key ref counts with sort_keys enabled 2022-04-13 03:02:55 +00:00
JustAnotherArchivist 9ac2133e0f Add ref count checks to fuzz tests 2022-04-13 02:52:17 +00:00
JustAnotherArchivist 935fe0cec4 Fix segmentation fault when an exception is raised while converting a dict key to a string
Fixes #522
2022-04-13 00:04:24 +00:00
JustAnotherArchivist 62dec8de71 Fix ref counting on non-string dict keys
For bytes, there was an extraneous INCREF; PyIter_Next returns a new reference. For other non-strings, the original itemName before converting to a string was never dereferenced.

Fixes #419
2022-04-07 20:31:36 +01:00
JustAnotherArchivist 2d1f088c2e Fix ref counting on repeated default function calls
Fixes #523
2022-04-07 20:20:01 +01:00
JustAnotherArchivist f6860f1f3d Remove shebang
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-05 21:04:39 +01:00
JustAnotherArchivist 3c095f1912 Widen tests to cover more possible buffer overflows
If the default output format changes in the future (e.g. `separators` as in the standard library), these tests would otherwise become irrelevant.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend 20aa1a69e5 Add a fuzzing test to search for segfaults in encoding. 2022-04-05 21:04:39 +01:00
Brénainn Woodsend 61dd6f19e8 Fix unchecked buffer overflows (CVE-2021-45958).
Add a few extra memory reserve calls to account for the extra space that
indentation needs.

These kinds of memory issues are hard to spot because the buffer is resized in
powers of 2 meaning that a miscalculation would only show any symptoms if the
required buffer size is estimated to be just below a 2 power but is actually
just above. Add a debug mode which replaces the 2 power scheme with reserving
only the memory explicitly requested and adds some overflow checks.
2022-04-05 21:04:39 +01:00
pre-commit-ci[bot] 2421524a1c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-04 19:28:00 +00:00
Jon Crall 9f0326265d
Update tests/test_ujson.py
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-04 15:27:41 -04:00
pre-commit-ci[bot] 3f9f9076fb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-04 18:22:41 +00:00
joncrall bb35930777
Added more nan/inf tests 2022-04-04 14:22:24 -04:00
joncrall 749012c4a4
Ran black 2022-04-04 13:56:19 -04:00
joncrall 13aa30e152
Fix nan bug in pandas port 2022-04-04 13:56:19 -04:00
joncrall f090103b31
NaN and Inf in loads - Port of Pandas #30295 2022-04-04 13:56:11 -04:00
pre-commit-ci[bot] c930b22f18 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-03 21:53:28 +00:00
JustAnotherArchivist 4bd21e2483 Fix exceptions on encoding list or dict elements and non-overflow errors on int handling getting silenced
Fixes #273
2022-02-16 08:17:47 +00:00
JustAnotherArchivist 4ffc7dd78f Verify that JSONDecodeError is an actual subclass of ValueError, not just an alias 2022-02-05 23:38:06 +00:00
JustAnotherArchivist 316d384f41
Raise JSONDecodeError in place of ValueError on failed decode (#498)
So as to match the behaviour of Python's json library.
Fixes #497
2022-02-05 20:39:05 +00:00
Hugo van Kemenade 3bbb64d3de Replace README.rst with .md 2021-09-20 13:30:37 +03:00
garenchan b7fba98136 Add a default keyword argument to dumps
dump and dumps functions in python json stdlib have a default keyword argument.
It's useful for serializing complex objects. Supporting this argument will improve compatibility and flexibility of ujson.
2021-09-06 09:55:37 +08:00
pre-commit-ci[bot] e8fb386673 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-04-12 16:41:58 +00:00
David W.H. Swenson cdcf5becd1
move test into parametrized test 2020-11-15 20:01:07 +01:00
David W.H. Swenson 6013e71381
Merge remote-tracking branch 'upstream/master' into fix_large_floats 2020-11-15 19:56:19 +01:00
Hugo van Kemenade 13e2ac7eea
Merge pull request #443 from dwhswenson/match_python_exponents 2020-11-15 19:25:37 +02:00
David W.H. Swenson 954a9a0a00
cleanup 2020-11-11 16:54:57 +01:00
David W.H. Swenson a48f8b22f1
Set same bounds as std lib for negative exponent 2020-11-11 16:41:34 +01:00
David W.H. Swenson b773bf05dc
Fix errors on reading long decimal floats 2020-11-11 14:51:27 +01:00
David W.H. Swenson af699c3cd0
Match Python json output for exponents 2020-11-11 14:41:51 +01: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
Mark Bishop 7687b3de7a Fix dealing with None types 2020-10-30 16:48:27 -04:00
Hugo van Kemenade 9d9fb9d09f
Merge pull request #424 from hugovk/rm-3.5 2020-10-06 19:39:11 +03:00
Chen-Han Hsiao (Stanley) 5b979eeebf Fix indent and add test case 2020-09-17 22:41:00 +08:00
Hugo van Kemenade 197a7fd4d8 Update pre-commit 2020-09-08 21:36:50 +03:00
Hugo 1ed1555d33 Remove BOM from file to fix PyPy3, and remove encoding definition with pyupgrade 2020-06-13 23:15:53 +02:00
Michał Górny 687b883713 Skip GC tests on PyPy 2020-06-12 15:21:02 +02:00