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 martin.panter
Recipients Vladimir Mihailenco, gregory.p.smith, martin.panter, nadeem.vawda, twouters, xiang.zhang
Date 2016-06-02.03:59:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464839986.26.0.921838425045.issue27164@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-06-02 03:59:46martin.pantersetrecipients: + martin.panter, twouters, gregory.p.smith, nadeem.vawda, xiang.zhang, Vladimir Mihailenco
2016-06-02 03:59:46martin.pantersetmessageid: <1464839986.26.0.921838425045.issue27164@psf.upfronthosting.co.za>
2016-06-02 03:59:46martin.panterlinkissue27164 messages
2016-06-02 03:59:45martin.pantercreate