Message266871
Thanks for the patches. Maybe Gregory knows more about this than I do (I never used zdict). But I think I have figured it out today, so I left some review comments :)
I’m not sure whether this really is a bug fix, although it would have little if any impact on existing code. It seems zdict was implemented with just the non-raw zlib format in mind, so supporting raw deflate mode is a new feature. If we were to add full support of inflateSetDictionary() for raw deflate mode, I imagine it would be a new decompressobj.set_dictionary() method.
I did some quick tests with specifying an unnecessary zdict buffer to the decompressor (when zdict not used for compression), and it doesn’t _seem_ to break anything, but I am not 100% sure.
Notes from my learning what zdict means:
Zdict seems to be a bunch of user data to setup or train the (de)compressor with. It was added by Issue 14684. (Not a Python dictionary, nor any special zlib dictionary format. The Python documentation is confusing, and the Go documentation made more sense, assuming it is equivalent.)
See the documentation of in/deflateSetDictionary() in <http://www.zlib.net/manual.html> or zlib.h. Looking through the history at <https://github.com/madler/zlib> can also be useful. |
|
Date |
User |
Action |
Args |
2016-06-02 03:59:46 | martin.panter | set | recipients:
+ martin.panter, twouters, gregory.p.smith, nadeem.vawda, xiang.zhang, Vladimir Mihailenco |
2016-06-02 03:59:46 | martin.panter | set | messageid: <1464839986.26.0.921838425045.issue27164@psf.upfronthosting.co.za> |
2016-06-02 03:59:46 | martin.panter | link | issue27164 messages |
2016-06-02 03:59:45 | martin.panter | create | |
|