Skip to content

Python 3 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

2020-03-07 23:02:21

Probably you have something like this

body = str(response.read().decode('utf8'))

Try this

gzipFile = gzip.GzipFile(fileobj=response)
body = str(gzipFile.read())