This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author quentel
Recipients christian.heimes, martin.panter, quentel, r.david.murray, terry.reedy, v+python, vstinner
Date 2017-08-15.08:00:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502784002.24.0.135028087518.issue30576@psf.upfronthosting.co.za>
In-reply-to
Content
On Python-ideas someone asked if other compressions could be supported besides gzip.

The latest version of the PR adds a mechanism for that : SimpleHTTPRequestHandler has a new attribute "compressions", a dictionary that maps compression encodings (eg "gzip") to a "compressed data generator". The generator takes a file object as argument, yields non-empty chunks of compressed data and ends by yielding b'' for compliance with Chunked Transfer Encoding protocol.

To support other compression algorithms, "compressions" can be extended with another key (eg "brotli") mapped to the appropriate generator. A test has been added with the non-standard "bzip2" encoding, using the bz2 module in the standard distribution.

I also added support for "deflate" by default (it's very close to "gzip").
History
Date User Action Args
2017-08-15 08:00:02quentelsetrecipients: + quentel, terry.reedy, vstinner, christian.heimes, v+python, r.david.murray, martin.panter
2017-08-15 08:00:02quentelsetmessageid: <1502784002.24.0.135028087518.issue30576@psf.upfronthosting.co.za>
2017-08-15 08:00:02quentellinkissue30576 messages
2017-08-15 08:00:01quentelcreate