Kozea/WeasyPrint — pull request #86 by ariofrio (2013-05-17 10:58:34+00:00)
Title: Add support for Gzip encoding

Some websites, like Wikipedia, send us a Gzip-encoded web page even if we don't
ask for it. This usually happens when the page is very large. Try this to see
what I mean:

curl -vI http://en.wikipedia.org/wiki/Spanish_language |& grep '^[<>]'

This patch helps us deal with those websites, and speeds things up, at least on
Python 3.2 and up. Previous versions [don't support GzipFile streaming][gzip],
so we read the whole file to a StringIO before decoding with GzipFile.

[gzip]: http://bugs.python.org/issue11608