circuitpython/extmod
warriorofwire eb3d5fa453 ujson: do not eat trailing whitespace
Ujson should only worry about whitespace before JSON.  This becomes apparent when you are using MP stream protocol to read directly from input buffers.

When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.

Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.

Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.

Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```

- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
2020-05-10 20:45:42 -07:00
..
crypto-algorithms extmod/crypto-algorithms/sha256: Remove non-standard memory.h header. 2017-04-27 15:01:01 +03:00
lwip-include WIP: complete manual inspection of all significant changes 2018-07-23 21:34:25 -04:00
re1.5 extmod/ure: Handle some escape sequences. 2019-02-14 15:42:25 +01:00
ulab@cf61d728e7 ulab: update 2020-04-27 07:46:48 -05:00
font_petme128_8x8.h Move font dependency to extmod from stm32 2019-10-13 19:33:03 -04:00
machine_i2c.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
machine_i2c.h protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
machine_mem.c remove unnecessary GCC pragmas 2020-01-02 18:03:18 -05:00
machine_mem.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
machine_pinbase.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
machine_pinbase.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pulse.c extmod/machine_pulse: Make time_pulse_us() not throw exceptions. 2017-02-05 14:20:17 +03:00
machine_pulse.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_signal.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
machine_signal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_spi.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
machine_spi.h protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
misc.h extmod/uos_dupterm: Update uos.dupterm() and helper funcs to have index. 2017-10-13 20:01:57 +11:00
modbtree.c raise mp_raise_NotImplementedError 2020-01-02 18:00:36 -05:00
modframebuf.c Fix subclassing of objects that are tested. Others may still be broken. 2020-01-27 14:52:42 -08:00
modlwip.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modonewire.c extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t. 2017-07-29 18:24:16 +03:00
modubinascii.c Compress all translated strings with Huffman coding. 2018-08-16 17:40:57 -07:00
modubinascii.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
moductypes.c remove unnecessary GCC pragmas 2020-01-02 18:03:18 -05:00
moduhashlib.c fixup micropy 2019-01-14 18:09:02 -08:00
moduheapq.c Fix esp and samd 2018-08-16 17:41:35 -07:00
modujson.c ujson: do not eat trailing whitespace 2020-05-10 20:45:42 -07:00
modurandom.c Revert subscr signature change 2019-12-13 14:29:15 -05:00
modure.c conditionalize re object type name 2019-02-21 15:11:54 -05:00
moduselect.c Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master. 2017-08-25 22:17:07 -04:00
modussl_axtls.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modussl_mbedtls.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modutimeq.c More make_new fixes for unix build 2019-01-18 11:53:09 -08:00
moduzlib.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modwebrepl.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modwebsocket.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
modwebsocket.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
uos_dupterm.c Fix esp and samd 2018-08-16 17:41:35 -07:00
utime_mphal.c py,extmod: Some casts and minor refactors to quiet compiler warnings. 2017-07-07 11:32:22 +10:00
utime_mphal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs.c Revert subscr signature change 2019-12-13 14:29:15 -05:00
vfs.h protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
vfs_fat.c avoid os.stat() int overflow on smallint-only builds 2020-02-14 18:33:37 -05:00
vfs_fat.h Add option to disable the concurrent write protection 2019-02-21 10:45:41 -08:00
vfs_fat_diskio.c merge finished 2018-07-28 13:29:47 -04:00
vfs_fat_file.c preserve errno in OSError 2020-02-04 16:19:40 -05:00
vfs_posix.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
vfs_posix.h continued WIP: almost compiling 2018-07-12 14:13:51 -04:00
vfs_posix_file.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
vfs_reader.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
virtpin.c protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
virtpin.h protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00