-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(serializer): Add support for
byterray
and memoryview
built-in…
… types (#1833) Both `bytearray` and `memoryview` built-in types weren't explicitly mentioned in the serializer logic, and as they are subtyping Sequence, this led their instances to be enumerated upon, and to be output as a list of bytes, byte per byte. In the case of `memoryview`, this could also lead to a segmentation fault if the memory referenced was already freed and unavailable to the process by then. By explicitly adding them as seralizable types, bytearray will be decoded as a string just like bytes, and memoryview will use its __repr__ method instead. Close GH-1829 Co-authored-by: Thomas Dehghani <thomas.dehghani@imc.com>
- Loading branch information
Showing
3 changed files
with
33 additions
and
4 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