Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Additional security hardening improvements: | Bob Ippolito | 2023-04-05 | 1 | -7/+11 |
| | | | | | | | | * Remove unused namedtuple_as_object and tuple_as_array arguments from simplejson.load (SJ-PT-23-102) * Remove vestigial _one_shot code from iterencode (SJ-PT-23-103) * Change default of allow_nan from True to False and add allow_nan to decoder (SJ-PT-23-107) | ||||
* | SJ-PT-23-100: Fix inconsistencies in error messages between C and Python ↵ | Bob Ippolito | 2023-04-04 | 1 | -4/+4 |
| | | | | implementations | ||||
* | SJ-PT-23-02: Fix missing reference count decrease | Bob Ippolito | 2023-04-04 | 1 | -1/+3 |
| | |||||
* | Revert unnecessary change | Bob Ippolito | 2022-11-14 | 1 | -1/+2 |
| | |||||
* | Rename variable for clarity | Bob Ippolito | 2022-11-14 | 1 | -5/+5 |
| | |||||
* | Implement speedups for #301 | Bob Ippolito | 2022-11-14 | 1 | -62/+68 |
| | |||||
* | Raise TypeError when _asdict() is callable but does not return a dict | Bob Ippolito | 2021-08-23 | 1 | -0/+5 |
| | |||||
* | Move the PyDict_Check after the _asdict call. | Gregory P. Smith [Google LLC] | 2021-08-20 | 1 | -6/+6 |
| | | | | Add a unittest. | ||||
* | Fix the C extension module to harden is_namedtuple. | Gregory P. Smith [Google LLC] | 2021-07-16 | 1 | -0/+6 |
| | | | | | | | Protects against looks-a-likes such as Mocks. Also prevent dict encoding from causing an unraised SystemError when encountering a non-Dict. Noticed by running user tests against a CPython interpreter with C asserts enabled (COPTS += -UNDEBUG). | ||||
* | fix indentation | Benjamin Peterson | 2018-06-26 | 1 | -1/+1 |
| | |||||
* | On Python 2, decode empty strings as str not unicode. | Benjamin Peterson | 2018-06-26 | 1 | -7/+8 |
| | | | | | | | | | | | | | | | | In general on Python 2, simplejson decodes ASCII strings as str, only promoting to unicode when needed: >>> simplejson.loads('["Spaetzle", "Spätzle"]') ['Spaetzle', u'Sp\xe4tzle'] Since 83a493db6a8b859ec7b10fa85365dd3fdf144c68, though, simplejson has always decoded empty JSON strings as unicode: >>> simplejson.loads('""') u'' This PR restores the old behavior of decoding empty strings as str. | ||||
* | Clean up the C code. | Serhiy Storchaka | 2018-04-25 | 1 | -141/+105 |
| | | | | | | | | | * Define less version-specific macros. * Remove redundant version checks and code inside version-specific code. * Always check `PyUnicode_READY()` for external unicode objects. * Use `PyUnicode_Join()`. * Use `PyUnicode_FromOrdinal()`. * All Python string constants are now allocated only once. | ||||
* | Allow to disable serializing bytes by default in Python 3.bytes-encoding | Serhiy Storchaka | 2018-04-25 | 1 | -9/+20 |
| | | | | | If encoding is None, then bytes objects will be passed to the default() method instead of transforming into unicode. | ||||
* | Defer is_raw_json test | Richard van der Hoff | 2018-04-03 | 1 | -6/+6 |
| | | | | | | Instances of RawJSON are unusual; by moving the test for them to lower in encoder_listencode_obj, we get a 12% performance improvement in my tests by not doing the instanceof test. | ||||
* | maybe fix windows 2.x build | Bob Ippolito | 2017-11-24 | 1 | -1/+2 |
| | |||||
* | Fix a compile error on 2.x. Closes #193.speedups-compile-error-2.7 | Serhiy Storchaka | 2017-11-24 | 1 | -1/+1 |
| | |||||
* | Merge pull request #191 from simplejson/type-error-messages | Bob Ippolito | 2017-11-23 | 1 | -1/+3 |
|\ | | | | | Make TypeError messages contain type name instead of a repr. | ||||
| * | Make TypeError messages contain type name instead of a repr. | Serhiy Storchaka | 2017-11-10 | 1 | -1/+3 |
| | | | | | | | | | | | | The failure depends on the type, not on the value of an object. This combines CPython's issues 26623 and 24641. | ||||
* | | Merge pull request #188 from simplejson/bpo-31505 | Bob Ippolito | 2017-11-20 | 1 | -3/+18 |
|\ \ | |/ |/| | bpo-31505: Fix an assertion failure in json, in case _json.make_encoder() received a bad encoder() argument. | ||||
| * | bpo-31505: Fix an assertion failure in json, in case _json.make_encoder() ↵ | Serhiy Storchaka | 2017-11-06 | 1 | -3/+18 |
| | | | | | | | | | | | | received a bad encoder() argument. Original patch by Oren Milman. | ||||
* | | bpo-31095: fix potential crash during GC (#187) | Serhiy Storchaka | 2017-11-06 | 1 | -2/+4 |
| | | | | | | Original patch by INADA Naoki. | ||||
* | | Fix a reference leak when sort keys. (#186) | Serhiy Storchaka | 2017-11-06 | 1 | -2/+5 |
|/ | |||||
* | Fix #184 threaded import issue, prep v3.12.0v3.12.0 | Bob Ippolito | 2017-11-05 | 1 | -21/+21 |
| | |||||
* | Fix #173 with item_sort_key and add auto-discovery to test suite | Bob Ippolito | 2017-06-19 | 1 | -11/+11 |
| | |||||
* | Merge pull request #170 from simplejson/strict-to-bool | Bob Ippolito | 2017-06-08 | 1 | -24/+14 |
|\ | | | | | Call PyObject_IsTrue() only once for the strict argument of scanner. | ||||
| * | Call PyObject_IsTrue() only once for the strict argument of scanner.strict-to-bool | Serhiy Storchaka | 2017-05-21 | 1 | -24/+14 |
| | | |||||
* | | Fix a crash wish unencodable encoding in the encoder.unencodable-encoder-encoding | Serhiy Storchaka | 2017-05-21 | 1 | -1/+6 |
|/ | | | | | JSONEncoder.encode() crashed in Python 3 when encoded bytes keys if the encoding was not encodable to utf-8 (contained surrogates). | ||||
* | Added missed ";" in Python 2 only code. | Serhiy Storchaka | 2017-05-21 | 1 | -1/+1 |
| | |||||
* | Merge pull request #168 from simplejson/no-py2.4 | Bob Ippolito | 2017-05-20 | 1 | -13/+0 |
|\ | | | | | Remove remnants of Python 2.4 support. | ||||
| * | Remofe remnants of Python 2.4 support.no-py2.4 | Serhiy Storchaka | 2017-05-08 | 1 | -13/+0 |
| | | | | | | | | Clean up the code by removing workarounds for supporting Python 2.4. | ||||
* | | Fix argument checking errors in _speedups.c. | Serhiy Storchaka | 2017-05-12 | 1 | -34/+69 |
| | | | | | | | | | | | | | | Always check PyObject_IsTrue() for error. Also fix integer overflow in the int_as_string_bitcount argument. Fixes #167. | ||||
* | | Don't set tp_new to PyType_GenericNew.remove-init-methods | Serhiy Storchaka | 2017-05-08 | 1 | -2/+0 |
| | | |||||
* | | Remove the `__init__` methods in extension classes. | Serhiy Storchaka | 2017-05-07 | 1 | -76/+31 |
|/ | | | | | | | Calling the `__init__` methods repeatedly causes memory leaks. Not calling the `__init__` methods causes a core dump. Fixes #165. Ported from https://bugs.python.org/issue30243. | ||||
* | Add support for preprocessed JSON strings (with optimizations) in encoder | Kevin LaFlamme | 2016-09-01 | 1 | -0/+22 |
| | | | | In some situations, you may have a large python dictionary you need to JSONify but one of the values inside the dict is already a JSON string. This is common when pulling an object from a database, for example, where one of the fields is a JSON blob/string. Previously you would have to deserialize and then reserialize that string just to serialize the high level object, but obviously this is unnecessarily slow. This changes adds a method/type that can be used to wrap a str and tell the serializer to just pass it through instead. | ||||
* | v3.8.2 - fix compiler warning, automated wheel builds for Windows and Macv3.8.2wheels | Bob Ippolito | 2016-02-15 | 1 | -1/+1 |
| | |||||
* | removed from _speedups.c forgotten "iterable_as_array" without comma after ↵ | Costy Petrisor | 2015-09-03 | 1 | -1/+0 |
| | | | | string | ||||
* | clean up iterable_as_array for 3.8.0v3.8.0 | Bob Ippolito | 2015-07-18 | 1 | -1/+2 |
| | |||||
* | Merge branch 'master' into iterable_as_array-gh1 | Nick Babcock | 2015-07-10 | 1 | -502/+1205 |
|\ | | | | | | | | | | | | | | | | | | | | | | | Conflicts: CHANGES.txt conf.py index.rst setup.py simplejson/__init__.py simplejson/_speedups.c simplejson/encoder.py simplejson/tests/test_tuple.py | ||||
| * | Fix msvc error C2275: 'PyObject' : illegal use of this type as an expression | Christoph Gohlke | 2015-05-18 | 1 | -2/+4 |
| | | |||||
| * | no longer trust custom repr for int/long/float subclasses #118v3.7.0 | Bob Ippolito | 2015-05-18 | 1 | -4/+43 |
| | | |||||
| * | Fix memory leak when an error occurs encoding dict items | Keith Bussell | 2014-10-23 | 1 | -0/+1 |
| | | |||||
| * | Fix lower bound checking in scan_once / raw_decode API #98v3.5.3 | Bob Ippolito | 2014-06-24 | 1 | -2/+2 |
| | | |||||
| * | fix build for VS 2008 | Gabi Davar | 2014-05-23 | 1 | -1/+1 |
| | | |||||
| * | detabv3.5.0 | Bob Ippolito | 2014-05-21 | 1 | -101/+101 |
| | | |||||
| * | clean up #96 and prep for v3.5.0 release | Bob Ippolito | 2014-05-21 | 1 | -19/+22 |
| | | |||||
| * | Merge pull request #96 from coldeasy/int_as_string_bitcount | Bob Ippolito | 2014-05-20 | 1 | -36/+74 |
| |\ | | | | | | | Adding `int_as_string_bitcount` option | ||||
| | * | Allocate int_as_string bounds once per encoder | Colin Deasy | 2014-05-20 | 1 | -31/+36 |
| | | | |||||
| | * | Adding `int_as_string_bitcount` option | Colin Deasy | 2014-05-14 | 1 | -22/+55 |
| | | | |||||
| * | | fix arg check for item_sort_key | Bob Ippolito | 2014-05-20 | 1 | -1/+3 |
| |/ | |||||
| * | pass-through in decoder for lone surrogates #62v3.3.0surrogate-62baserock/morph | Bob Ippolito | 2013-05-07 | 1 | -57/+41 |
| | |