In brief
gzip.open() can provide text mode with an explicit encoding. Compressed text can then be read sequentially without first writing a complete uncompressed file.
Useful to know
gzip.open() can provide text mode with an explicit encoding. Compressed text can then be read sequentially without first writing a complete uncompressed file. [1]
Distinguish compression from character encoding. A valid gzip container does not prove its contents are UTF-8. With external input, also limit the expanded size, which can greatly exceed the downloaded data.
Sources
For further detail and to check the information: