This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be more strict about unicode/bytes conversions (#147)
* Be more strict about unicode/bytes conversions Previously this library relied upon duck-typed behavior, instead of following precise schemas for the conversions between ctypes structs and dictionaries of python objects. This led to unicode decode errors, as bytestrings not representing human readable content were being decoded. This fixes this issue in the following ways: - Add `to_dict` methods to each relevant struct class that knows exactly which fields are bytes and which are strings, and handles all conversions appropriately. - Make `ensure_bytes` and `ensure_string` more strict in terms of input and output. * fileds -> fields
- Loading branch information
Showing
4 changed files
with
49 additions
and
40 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
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