[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset d91b951e676f by Martin Panter in branch '3.5': Issue #27164: Allow decompressing raw Deflate streams with predefined zdict https://hg.python.org/cpython/rev/d91b951e676f New changeset 470954641f3b by Martin Panter in branch 'default': Issue #27164:

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Xiang Zhang
Xiang Zhang added the comment: It looks good. I don't think that is a matter since usually I will do a search before change. But of course extracting them to a subroutine helps. -- ___ Python tracker _

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-04 Thread Martin Panter
Martin Panter added the comment: Here is a patch which I propose to use that factors out a set_inflate_zdict() function. I think this will help with maintainence, e.g. if someone changes the UINT_MAX checking, but forgets that there are two places than need changing. Let me know if that is oka

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-02 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: gregory.p.smith -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your review, Martin. :) I have replied with after thinking and try. Yes, this is more like a feature request. But for the end user, this behaviour is quite like a bug. > If we were to add full support of inflateSetDictionary() for raw deflate > mode,

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Martin Panter
Martin Panter added the comment: 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

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mail

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: Forget to add test. Upload a new one with test included. -- Added file: http://bugs.python.org/file43085/issue27164_with_test.patch ___ Python tracker

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: I think my conclusion in last message is right. A similar bug in CPAN can be found in https://rt.cpan.org/Public/Bug/Display.html?id=36046. And I can find in zlib's changelog inflateSetDictionary starts to support raw inflate from 1.2.2.1. Patch attached now all

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: This seems related with the difference between zlib format and raw format. When you do raw inflate, you have to inflateSetDictionary before any inflate. You cannot rely on the first inflate to return Z_NEED_DICT and then do inflateSetDictionary. Although I have

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-05-31 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-05-31 Thread Vladimir Mihailenco
New submission from Vladimir Mihailenco: Consider following code: ``` import zlib hello = b'hello' # Compress data using deflate and shared/predefined dict. co = zlib.compressobj(wbits=-zlib.MAX_WBITS, zdict=hello) data = co.compress(hello) + co.flush() # Decompress deflate by providing same