circuitpython/shared-bindings
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
..
_bleio trivial change to force rebuild 2020-05-04 23:05:47 -04:00
_eve Split ROMDECLS for readability 2020-02-13 07:28:21 -08:00
_pew Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
_pixelbuf Update wheel to colorwheel and fix RGB order. 2020-05-08 14:44:41 -04:00
_stage circuitpython-stage: allow choosing background color 2020-01-30 15:24:04 +01:00
aesio aesio: add basic AES encryption and decryption 2020-05-06 17:40:06 +08:00
analogio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiobusio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiocore ulab: Incorporate it 2020-02-27 11:03:03 -06:00
audioio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
audiomixer audiosample: convert to use a protocol 2019-12-04 09:31:52 -06:00
audiomp3 fix doc build error 2020-01-06 09:26:32 -06:00
audiopwmio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
bitbangio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
board Corrected UART output. 2020-04-30 19:14:51 -05:00
busio ujson: do not eat trailing whitespace 2020-05-10 20:45:42 -07:00
digitalio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
displayio displayio: Fix "bus type" problem introduced at 8cba145c90 2020-04-21 13:48:34 -05:00
fontio Fix reference to Bitmap in fontio.Glyph docs. 2019-06-18 18:44:50 -05:00
framebufferio framebufferio: update copyright information 2020-04-17 18:44:07 -05:00
frequencyio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
gamepad When clearing gamepad buffer, use the last button state, not 0 2019-06-12 11:42:41 -07:00
gamepadshift When clearing gamepad buffer, use the last button state, not 0 2019-06-12 11:42:41 -07:00
i2cslave rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
math Support internationalisation. 2018-08-07 14:58:57 -07:00
microcontroller Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
multiterminal Support internationalisation. 2018-08-07 14:58:57 -07:00
neopixel_write Fix iMX builds 2020-03-31 17:00:30 -07:00
network Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
nvm Revert subscr signature change 2019-12-13 14:29:15 -05:00
os avoid os.stat() int overflow on smallint-only builds 2020-02-14 18:33:37 -05:00
ps2io rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
pulseio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
random Merge branch 'master' into new-pixelbuf-api 2019-12-20 19:22:27 -05:00
rgbmatrix RGBMatrix: nonessential change to kick Actions 2020-04-19 09:10:08 -05:00
rotaryio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
rtc Fix type in RTC documentation. 2020-05-06 14:11:11 -05:00
socket protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
storage Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
struct Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
supervisor Remove nRF52832 support 2018-12-30 22:49:20 -05:00
terminalio protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
time time.sleep() rounds to nearest msec 2020-02-07 10:24:11 -05:00
touchio rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
uheap Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
ulab ulab: Update from upstream 2020-04-22 09:04:12 -05:00
usb_hid A variety of displayio improvements 2019-02-11 20:55:05 -08:00
usb_midi protocols: Allow them to be (optionally) type-safe 2019-12-04 09:29:57 -06:00
ustack Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
wiznet rename routines to be clearer; fix wiznet arg types 2020-03-05 16:35:31 -05:00
help.c Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
index.rst update rST ref link for support matrix 2019-07-28 21:25:43 -05:00
support_matrix.rst update rST ref link for support matrix 2019-07-28 21:25:43 -05:00
util.c Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
util.h Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00