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.

classification
Title: Add copy() method to zlib's compress and decompress objects
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: catlee, georg.brandl, nnorwitz
Priority: normal Keywords: patch

Created on 2006-02-20 20:17 by catlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
zlib-patch.diff catlee, 2006-02-20 20:17 Diff against revision 42524
Messages (6)
msg49546 - (view) Author: Chris AtLee (catlee) * Date: 2006-02-20 20:17
The attached patch adds a copy() method to zlib's
compressobj and decompressobj.  Copying a
(de)compression object allows a developer to store the
state of the (de)compressor at a certain point of the
input stream in order to more efficiently compress data
sharing some identical header, or to more efficiently
seek inside compressed data.

Doc/lib/libzlib.tex is updated with descriptions for
the new methods.

Lib/test/test_zlib.py is updated to test the new
functionality.

The patch is against revision 42524 in
http://svn.python.org/projects/python/trunk
msg49547 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-24 06:02
Logged In: YES 
user_id=33168

You need to check the return result of newcompobject(). 
This would crash if it returns NULL.

You also need to change METH_VARARGS to METH_NOARGS since
these methods don't take any arguments.

The doc should contain \versionadded{2.5} before the end
markers for new methods.
msg49548 - (view) Author: Chris AtLee (catlee) * Date: 2006-03-27 18:52
Logged In: YES 
user_id=186532

New patch attached with the mentioned changes made.

I noticed that PyZlib_unflush() takes an argument, but that
its use is not documented.  Should the docs be updated to
explain what that argument is for?
msg49549 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-27 18:56
Logged In: YES 
user_id=33168

Yes, please fix any docs you find lacking.  Also, please
create a new patch.  Thanks!
msg49550 - (view) Author: Chris AtLee (catlee) * Date: 2006-03-27 21:46
Logged In: YES 
user_id=186532

Patch for the unflush() docs is uploaded as #1459631
msg49551 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-16 07:38
Logged In: YES 
user_id=849994

Corrected the patch and applied in rev. 46012.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42925
2006-02-20 20:17:04catleecreate