On Thursday, 2018-07-05 15:17:44 +0200, Mathieu Bridon wrote:
> 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
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