1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-05-07 22:16:12 +02:00
Commit Graph

916 Commits

Author SHA1 Message Date
Hugo van Kemenade b5ce31296e Create wheel for PyPy3.9 2022-09-14 21:33:47 +03:00
Hugo van Kemenade 68493f8b3e Extract single matrix factor 2022-09-14 21:33:47 +03:00
Hugo van Kemenade 734a569c4e Support Python 3.11 2022-09-14 21:33:47 +03:00
Hugo van Kemenade b29c9d51c8 GHA: Use ubuntu-latest (except pin to latest 22.04 for benchmark) 2022-09-13 23:01:49 +03:00
Hugo van Kemenade 565429b731 Bump actions 2022-09-13 23:01:49 +03:00
Brénainn Woodsend 203f311196 Appease setuptools deprecation of license_file. 2022-08-08 22:37:52 +01:00
Brénainn Woodsend b18f60d31f Fix encoding of infinity (#80).
Infinity was being encoded as 'Inf' which, whilst the JSON spec doesn't include
any non-finite floats, differs from the conventions in other JSON libraries,
JavaScript of using 'Infinity'. It also differs from what `ujson.loads()`
expects so that `ujson.loads(ujson.dumps(math.inf))` raises an exception.

Closes #80.
2022-08-08 22:37:52 +01:00
Hugo van Kemenade bcdc04184a
Merge pull request #561 from ultrajson/all-repos_autofix_pypa/gh-action-pypi-publish 2022-07-26 14:31:29 +03:00
Hugo van Kemenade cdcbca15b2 Replace deprecated pypa/gh-action-pypi-publish@master with @release/v1
Committed via https://github.com/asottile/all-repos
2022-07-25 21:21:11 +03:00
Tim Gates 264f60c018 docs: Fix a few typos
There are small typos in:
- python/objToJSON.c
- tests/test_ujson.py

Fixes:
- Should read `standard` rather than `stanard`.
- Should read `gibberish` rather than `jibberish`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-07-20 09:59:57 +01:00
Hugo van Kemenade 9204cbfe6b
Merge pull request #559 from hugovk/require-pr-label 2022-07-11 13:43:24 +03:00
Hugo van Kemenade 0c15e7f36f Add workflow to require changelog label for PRs 2022-07-11 13:01:01 +03:00
JustAnotherArchivist 8a946e5830 Add separators encoding parameter
Closes #283
2022-07-11 00:43:29 +01:00
Hugo van Kemenade b02bb27eac
Merge pull request #558 from ultrajson/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-07-04 22:09:32 +03:00
pre-commit-ci[bot] 00abb6bbb1
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.31.1 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.34.0)
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.3.0)
2022-07-04 18:44:27 +00:00
Hugo van Kemenade 9c20de0f77
Merge pull request from GHSA-fm67-cv37-96ff
Fix double free on string decoding if realloc fails
2022-07-02 08:11:59 +03:00
JustAnotherArchivist b21da40ead Fix double free on string decoding if realloc fails 2022-06-27 22:26:31 +00:00
Hugo van Kemenade 67ec071833
Merge pull request #555 from JustAnotherArchivist/fix-decode-surrogates-2 2022-06-20 21:15:24 +03:00
JustAnotherArchivist bc7bdff051 Replace wchar_t string decoding implementation with a uint32_t-based one
This fixes character handling on platforms with 16-bit wchar_t (notably, Windows), which was broken (in different ways) on both CPython and PyPy.

Fixes #552
2022-06-19 23:11:17 +00:00
Hugo van Kemenade cc701192c7
Merge pull request #548 from JustAnotherArchivist/arbitrary-ints
Add support for arbitrary size integers
2022-06-19 00:22:48 +03:00
Hugo van Kemenade 4b5ccccd6a
Merge pull request #553 from bwoodsend/pypy-ci 2022-06-18 20:40:23 +03:00
Hugo van Kemenade abe26fcd1d
Merge pull request #551 from bwoodsend/bye-bye-travis 2022-06-18 20:27:56 +03:00
Brénainn Woodsend 3efb5ccde7
Delete old TravisCI workflow and references. 2022-06-18 18:14:41 +01:00
Brénainn Woodsend 404de1a66f
xfail test_decode_surrogate_characters() on Windows PyPy.
This feature needs fixing. See #552.
2022-06-18 17:35:00 +01:00
Brénainn Woodsend f7e66dc554
Switch to musl docker base images. 2022-06-18 15:31:34 +01:00
Brénainn Woodsend 2d4f71af05
Move cross-architecture testing to GitHub Actions. 2022-06-18 15:28:12 +01:00
Hugo van Kemenade 63cbc07baf
Merge pull request #554 from hugovk/deploy-colour-logs 2022-06-18 15:01:59 +03:00
Hugo van Kemenade 291b7fbb8c Add colour to CI output 2022-06-18 12:03:36 +03:00
Brénainn Woodsend fb6251ee80
Renable CI/CD testing on PyPy for all platforms.
PyPy's Windows unicode handling transpired to be significantly different
enough that a PyPy+Windows specific test failure slipped in (#552).
2022-06-17 22:35:26 +01:00
JustAnotherArchivist 99709df977 More descriptive variable names 2022-06-17 14:18:29 +00:00
JustAnotherArchivist 773c04a8a6 Add big int test with dict sorting 2022-06-16 22:10:55 +00:00
JustAnotherArchivist e2097ab745 Refactor test_encode_decode_big_int per Brénainn's suggestion 2022-06-16 22:10:31 +00:00
JustAnotherArchivist 655e146777 Skip big integer encoding tests on PyPy for now 2022-06-16 17:26:19 +00:00
JustAnotherArchivist a8b35ef73a Fix tests for large ints 2022-06-16 17:26:19 +00:00
JustAnotherArchivist aa068e335f Add support for arbitrary size integers 2022-06-16 17:26:19 +00:00
Hugo van Kemenade b47c3a70b5
Merge pull request #550 from JustAnotherArchivist/fix-decode-surrogates
Fix handling of surrogates on decoding
2022-06-16 11:05:31 +03:00
Hugo van Kemenade d40cf50e9d
Merge pull request #549 from JustAnotherArchivist/fix-buffer-leak-encoding-errors 2022-06-14 17:12:17 +03:00
JustAnotherArchivist e84bbdede8 Rewrite memory leak test with tracemalloc 2022-06-13 20:19:56 +00:00
JustAnotherArchivist a646c42cb6
Call the right Python executable
Co-authored-by: Brénainn Woodsend <bwoodsend@gmail.com>
2022-06-10 16:31:41 +00:00
JustAnotherArchivist 1a24de5f1a Switch from VMS to USS 2022-06-09 22:29:43 +00:00
JustAnotherArchivist 5013dd442e Add test for fixed memory leak 2022-06-09 21:18:49 +00:00
JustAnotherArchivist e0e5db9a46 Fix handling of surrogates on decoding
This implements surrogate handling on decoding as it is in the standard library. Lone escaped surrogates and any raw surrogates in the input result in surrogates in the output, and escaped surrogate pairs get decoded into non-BMP characters. Note that raw surrogate pairs get treated differently on platforms/compilers with 16-bit `wchar_t`, e.g. Microsoft Windows.
2022-06-09 18:01:22 +00:00
JustAnotherArchivist 666d159db8 Fix memory leak on encoding errors when the buffer was resized
`JSON_EncodeObject` returns `NULL` when an error occurs, but without freeing the buffer. This leads to a memory leak when the buffer is internally allocated (because the caller's buffer was insufficient or none was provided at all) and any error occurs. Similarly, `objToJSON` did not clean up the buffer in all error conditions either.

This adds the missing buffer free in `JSON_EncodeObject` (iff the buffer was allocated internally) and refactors the error handling in `objToJSON` slightly to also free the buffer when a Python exception occurred without the encoder's `errorMsg` being set.
2022-06-04 19:32:56 +00:00
Hugo van Kemenade 4ac30c9b76
Merge pull request #547 from hugovk/update-test-matrix 2022-06-02 21:27:16 +03:00
Hugo van Kemenade eec8eb4f42 Add final noop job to mark as required 2022-06-02 17:43:03 +03:00
Hugo van Kemenade da4b03a430 Test Ubuntu on all Python versions, and the others on a single Python version 2022-06-02 17:13:24 +03:00
Hugo van Kemenade c60c1c4641 Remove print from test 2022-06-02 17:09:35 +03:00
Hugo van Kemenade f71d7c28ad
Merge pull request #544 from NaN-git/main
Integer parsing: always detect overflows
2022-06-01 22:56:20 +03:00
Hugo van Kemenade 66bb6e0584
Merge pull request #530 from JustAnotherArchivist/fix-encode-surrogates 2022-06-01 18:13:41 +03:00
JustAnotherArchivist 59aa3bf40e Fix bytesObj not getting assigned and DECREFd, resulting in a memory leak 2022-05-30 19:23:13 +00:00