Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pickler: handle arbitrary bytestreams using base64
The quoted-printable encoding seems to fall down under certain scenarios, e.g. HDF5 data, so make our bytes transport robust by using base64 to encode bytes for json. Use a new "B64" tag in the data stream to allow for backwards-compatibility. Support for decoding the old "BYTES" tag remains intact. New versions of jsonpickle now emit a new "B64" tag when bytes are encountered. Add a new unit test with the example HDF5 data to ensure that we will forever support it. Closes #143 Reported-by: Jason Liang <jasonzliang@berkeley.edu> Signed-off-by: David Aguilar <davvid@gmail.com>
- Loading branch information
Showing
6 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
|
||
BYTES = 'py/bytes' | ||
B64 = 'py/b64' | ||
FUNCTION = 'py/function' | ||
ID = 'py/id' | ||
INITARGS = 'py/initargs' | ||
|
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
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
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