homepage

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: Provide compress/uncompress functions on the gzip module
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, gregory.p.smith, jcea, pitrou, pythonhacker
Priority: normal Keywords: patch

Created on 2008年08月01日 17:56 by pythonhacker, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_gzip_svn_diff.patch pythonhacker, 2008年08月04日 04:29
gzip.py.svndiff pythonhacker, 2009年11月07日 17:41
gzip.rst.svndiff pythonhacker, 2009年11月07日 17:41
Messages (16)
msg70578 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月01日 17:56
Python has great in-built support for all sorts of text compression
including bzip, gzip, tarfile and other general purpose modules like
zlib etc.
Of these, I have a gripe with gzip - it does not provide a simple
way of compressing/uncompressing a string like the other modules
to (namely bzip, zlib) at the module level.
It is relatively easy to perform gzip de-compression using the
GzipFile class and StringIO objects, but compression is not
that straight-forward.
It would be great for the gzip module to have "compress"
and "uncompress" functions at the module level without having
to go through GzipFile every-time.
I think being able to send gzip compressed strings directly would be
useful for applications which require to send gzip data over the wire
without having to write to files and read-back.
msg70594 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月01日 21:23
Uploading a file containing two functions which can be used to provide
compress/uncompress on gzip.
This is not a patch to gzip.py, but a stand-alone file. It this looks
fine, I will make a patch.
msg70646 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008年08月02日 23:14
I think the functionality is useful, although it may be too late to make
it into 2.6/3.0. Some comments:
- the functions should have docstrings
- there should be unit tests
- style nit: named parameters in function calls (and default values in
function declarations) shouldn't have spaces around the '=' sign
msg70650 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月03日 06:08
Thanks. The file I uploaded was not an actual patch but just how the
functions would appear in the gzip module, to illustrate the code.
I can make an actual patch to gzip.py with docstrings, unit-tests and
taking care of your other comments. Do you think this will be in time
for Python 3.0 ? I can do this right away.
msg70657 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月03日 19:21
I have uploaded the actual patch file which can be applied against the
gzip.py module. I did not modify the _test() function since it is
written for testing file compression. I can modify test_gzip.py if this
patch is accepted.
msg70684 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月04日 04:10
Uploading the svn diff.
msg70686 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2008年08月04日 04:29
Added test case in test_gzip.py. Attaching svn diff of the same.
msg94382 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2009年10月23日 12:51
Can we include this for the next release ?
msg94432 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009年10月24日 18:21
Seems simple enough, I don't see why not.
msg94683 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009年10月29日 19:47
The patch lacks a documentation update, though.
(see Doc/library/gzip.rst)
msg94693 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2009年10月30日 03:59
Ok, I will add this.
msg95020 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2009年11月07日 17:41
Uploading fresh gzip.py SVN diff with a minor change, i.e accepting a
regular string as argument, aka zlib.compress.
msg95021 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2009年11月07日 17:41
Uploading rst documentation svn diff for module.
msg110680 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010年07月18日 20:13
This appears to have slipped under the radar, msg94432 seems to sum it up. Could someone please take this forward.
msg114170 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010年08月17日 21:13
Modified patch committed in r84155 (py3k). Thanks for your contribution!
msg117797 - (view) Author: Anand B Pillai (pythonhacker) * Date: 2010年10月01日 13:23
Okay. Verified as working. Thank you!
History
Date User Action Args
2022年04月11日 14:56:37adminsetgithub: 47738
2010年10月01日 13:23:52pythonhackersetmessages: + msg117797
2010年08月17日 21:13:39pitrousetstatus: open -> closed
resolution: fixed
messages: + msg114170

stage: patch review -> resolved
2010年07月18日 20:13:06BreamoreBoysetnosy: + BreamoreBoy
messages: + msg110680
2009年11月07日 17:41:43pythonhackersetfiles: + gzip.rst.svndiff

messages: + msg95021
2009年11月07日 17:41:04pythonhackersetfiles: + gzip.py.svndiff

messages: + msg95020
2009年11月07日 17:39:18pythonhackersetfiles: - gzip_svn_diff.patch
2009年11月07日 17:39:13pythonhackersetfiles: - gzip.patch
2009年11月07日 17:39:06pythonhackersetfiles: - gzip_patch.py
2009年10月30日 03:59:01pythonhackersetmessages: + msg94693
2009年10月29日 19:47:16pitrousetmessages: + msg94683
2009年10月24日 18:21:31gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg94432
2009年10月23日 12:57:01pitrousetpriority: normal
stage: patch review
versions: + Python 3.2, - Python 3.0
2009年10月23日 12:51:52pythonhackersetmessages: + msg94382
2008年08月14日 04:25:55jceasetnosy: + jcea
2008年08月04日 04:29:58pythonhackersetfiles: + test_gzip_svn_diff.patch
messages: + msg70686
2008年08月04日 04:10:17pythonhackersetfiles: + gzip_svn_diff.patch
messages: + msg70684
2008年08月03日 19:21:38pythonhackersetfiles: + gzip.patch
keywords: + patch
messages: + msg70657
2008年08月03日 06:08:02pythonhackersetmessages: + msg70650
2008年08月02日 23:14:25pitrousetnosy: + pitrou
messages: + msg70646
2008年08月01日 21:23:40pythonhackersetfiles: + gzip_patch.py
messages: + msg70594
2008年08月01日 17:56:55pythonhackercreate

AltStyle によって変換されたページ (->オリジナル) /