forked from ultrajson/ultrajson
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest v1.35 #1
Draft
kbaldyga
wants to merge
44
commits into
v1.34
Choose a base branch
from
last-v1.35
base: v1.34
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Latest v1.35 #1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It should return a raw JSON string which will be directly included in the resulting JSON when encoding.
Due to floating point differences in i386 versus x86-64, tests were failing on i386. Fixes GitHub issue ultrajson#178. As indicated in comments there, the long-term plan is to use strtod everywhere, but this fixes the test suite for purposes such as Ubuntu packaging that need to build and test the current version.
list item being replaced.
…under both Python 2 and Python 3, removing the need for 2to3 to be run. This indirectly fixes ultrajson#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 ultrajson#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 ultrajson#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.
escape_forward_slashes now only ignores forward slashes, not everythi…
Test on python 3.5 on travis
Corrected memory leak in sort_keys=True
Update tests for floating point inaccuracies
If an object has a __json__ method, use it when encoding
…m/timdawborn/ultrajson into timdawborn-correct_unit_tests_and_benchmarks Conflicts: tests/tests.py
…andhy-master Conflicts: tests/tests.py
…orks with python 2.6
this fixes issue ultrajson#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.
do not forcefully remove the build directory manually (fix ultrajson#179)
bring back benchmark introduction
1. It reduces clutter in symbol table. 2. It fixes issues with C99 inline semantics for functions marked as inline (ultrajson#237, ultrajson#180, ultrajson#222), which manifests when compiled with GCC>=5.
added "static" to C functions, where possible
Indent dict values
- 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)
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.
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.
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.
This functionality caused a performance regression without a use-case justifying the trade-off.
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".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're currently running v1.34. This PR is a diff between v1.34 and the latest working version of 1.35 (Couldn't get the latest master to compile, it also introduces incompatible changes)