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: Extended modes for tarfile.TarFile()
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: lars.gustaebel Nosy List: Sworddragon, lars.gustaebel, serhiy.storchaka
Priority: low Keywords:

Created on 2014-04-27 22:26 by Sworddragon, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg217320 - (view) Author: (Sworddragon) Date: 2014-04-27 22:26
tarfile.open() does support optionally an compression method on the mode argument in the form of 'filemode[:compression]' but tarfile.TarFile() does only suport 'a', 'r' and 'w'. Is there a special reason that tarfile.TarFile() doesn't directly support an optional compression method? Otherwise it would be nice if they could be used directly on tarfile.TarFile() too.
msg217345 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2014-04-28 06:34
That was a design decision. What would be the advantage of having the TarFile class offer the compression itself?
msg217354 - (view) Author: (Sworddragon) Date: 2014-04-28 10:06
The TarFile class provides more options. Alternatively a file object could be used but this means additional code (and maybe IO overhead).
msg217358 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2014-04-28 10:56
You can pass keyword arguments to tarfile.open(), which will be passed to the TarFile constructor. You can also use pass fileobj arguments to tarfile.open().
msg217361 - (view) Author: (Sworddragon) Date: 2014-04-28 11:09
Interesting, after reading the documentation again I would now assume that is what **kwargs is for.
msg217363 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2014-04-28 11:17
Jup. That's it.
History
Date User Action Args
2022-04-11 14:58:02adminsetgithub: 65568
2014-04-28 11:17:19lars.gustaebelsetstatus: open -> closed
priority: normal -> low
messages: + msg217363

resolution: not a bug
stage: resolved
2014-04-28 11:09:00Sworddragonsetmessages: + msg217361
2014-04-28 10:56:39lars.gustaebelsetmessages: + msg217358
2014-04-28 10:06:51Sworddragonsetmessages: + msg217354
2014-04-28 06:34:40lars.gustaebelsetassignee: lars.gustaebel
messages: + msg217345
2014-04-28 00:28:24berker.peksagsetnosy: + serhiy.storchaka
2014-04-28 00:18:08ned.deilysetnosy: + lars.gustaebel
2014-04-27 22:26:05Sworddragoncreate