下载图片时gzip碰到一个bug:
File "/Users/hipponensis/myprojects/crawlertool/douban_movies.py", line 136, in crawler_image
image_data = g.read()
File "/Users/hipponensis/.pyenv/versions/3.5.1/lib/python3.5/gzip.py", line 274, in read
return self._buffer.read(size)
File "/Users/hipponensis/.pyenv/versions/3.5.1/lib/python3.5/gzip.py", line 461, in read
if not self._read_gzip_header():
File "/Users/hipponensis/.pyenv/versions/3.5.1/lib/python3.5/gzip.py", line 409, in _read_gzip_header
raise OSError('Not a gzipped file (%r)' % magic)
看了这个, 了解到原因是内置模块设计不合理。