Pierre Quentel added the comment:

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").

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to