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: tarfile: Default value for compresslevel is not documented
Type: enhancement Stage: resolved
Components: Documentation, Library (Lib) Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Sworddragon, berker.peksag, docs@python, hamzatkhan94, martin.panter, matrixise, python-dev
Priority: normal Keywords: easy, patch

Created on 2015-10-28 08:39 by Sworddragon, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Issue25496.v1.patch hamzatkhan94, 2016-01-04 19:22 review
Messages (7)
msg253592 - (view) Author: (Sworddragon) Date: 2015-10-28 08:39
After ticket #21404 got solved I'm noticing that the default value for the compresslevel argument is not mentioned. Maybe this can be documented too.
msg253624 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2015-10-28 20:02
Hi Sworddragon,

Where compresslevel is not mentioned in the doc ?

Thank you
msg253655 - (view) Author: (Sworddragon) Date: 2015-10-29 05:38
At tarfile, but the compresslevel argument is mentioned there but not its default value.
msg257482 - (view) Author: Hamza T Khan (hamzatkhan94) * Date: 2016-01-04 19:22
Here is trivial fix for this issue. This is my first patch and I hope that it gets accepted and integrated.

hamza@hamza-ub94:~/git/cpython$ grep compresslevel Lib/tarfile.py
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
            fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
    def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
                              compresslevel=compresslevel)
hamza@hamza-ub94:~/git/cpython$
msg259988 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-02-10 06:56
For gzip compression, there is also a proposal to change the default: Issue 26253.

Anyway, the patch looks good for now.
msg263306 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-13 04:32
New changeset b1f3fe320adf by Martin Panter in branch '3.5':
Issue #25496: Document compresslevel defaults to 9, by Hamza T Khan
https://hg.python.org/cpython/rev/b1f3fe320adf

New changeset a04455866ec7 by Martin Panter in branch 'default':
Issue #25496: Merge tarfile doc from 3.5
https://hg.python.org/cpython/rev/a04455866ec7

New changeset 4b9d70d3ba1b by Martin Panter in branch '2.7':
Issue #25496: Document compresslevel defaults to 9, by Hamza T Khan
https://hg.python.org/cpython/rev/4b9d70d3ba1b
msg263310 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-04-13 06:05
Thanks for the patch Hamza
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69682
2016-04-13 06:05:49martin.pantersetstatus: open -> closed
resolution: fixed
messages: + msg263310

stage: patch review -> resolved
2016-04-13 04:32:33python-devsetnosy: + python-dev
messages: + msg263306
2016-04-12 19:14:04zach.waresethgrepos: - hgrepo330
2016-02-10 06:56:03martin.pantersetversions: + Python 2.7, - Python 3.4
nosy: + martin.panter

messages: + msg259988

stage: needs patch -> patch review
2016-01-04 19:22:22hamzatkhan94setfiles: + Issue25496.v1.patch

nosy: + hamzatkhan94
messages: + msg257482

hgrepos: + hgrepo330
keywords: + patch
2015-10-29 05:38:59Sworddragonsetmessages: + msg253655
title: Default value for compresslevel is not documented -> tarfile: Default value for compresslevel is not documented
2015-10-28 20:02:17matrixisesetnosy: + matrixise
messages: + msg253624
2015-10-28 09:41:33berker.peksagsetnosy: + berker.peksag, docs@python
versions: + Python 3.4, Python 3.6
assignee: docs@python
components: + Documentation
keywords: + easy
stage: needs patch
2015-10-28 08:39:27Sworddragoncreate