diff options
author | Mathieu Bridon <[email protected]> | 2018-06-17 14:40:31 +0200 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-08-01 14:26:19 +0100 |
commit | a71df20855e1d5e875042ca34de9401951fb96a6 (patch) | |
tree | e605d1b00c5a3cb8cb00747309fca84db79e50d9 /src/gbm/gbm-symbols-check | |
parent | 8678fe537a5eeb9a537fc540672bf375e802c004 (diff) |
python: Explicitly use byte strings
In both Python 2 and 3, zlib.Compress.compress() takes a byte string,
and returns a byte string as well.
In Python 2, the script was working because:
1. string literalls were byte strings;
2. opening a file in unicode mode, reading from it, then passing the
unicode string to compress() would automatically encode to a byte
string;
On Python 3, the above two points are not valid any more, so:
1. zlib.Compress.compress() refuses the passed unicode string;
2. compressed_data, defined as an empty unicode string literal, can't be
concatenated with the byte string returned by compress();
This commit fixes this by explicitly using byte strings where
appropriate, so that the script works on both Python 2 and 3.
Signed-off-by: Mathieu Bridon <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/gbm/gbm-symbols-check')
0 files changed, 0 insertions, 0 deletions