[issue31020] Add support for custom compressor in tarfile

2017-07-28 Thread insomniacslk

insomniacslk added the comment:

The documentation should be updated to suggest that a custom file-like object 
can be passed to have custom compressors then.

However this sounds very hacky and definitely not a feature that can be easily 
passed to the user. Hence the reason for a cleaner, explicitly advertised 
interface.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can pass a custom file object that implements a custom compression to the 
TarFile constructor. I don't see a need in other way.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
versions:  -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Adding serhiy.storchaka who recently made changes to tarfile.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Adding lars.gustaebel who is listed as maintainer for tarfile.

--
nosy: +Mariatta, lars.gustaebel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31020] Add support for custom compressor in tarfile

2017-07-24 Thread insomniacslk

New submission from insomniacslk:

Tarfile would benefit from exposing custom compressors. At the moment the only 
way to use something that is not gzip/bzip/lzma is to separate the archiving 
and compression steps.

A possible approach is to pass a custom compression function to 
`tarfile.TarFile.open`. However the current interface is not clean enough to be 
exposed. I have made a very conservative change via a pull request on GitHub, 
see https://github.com/python/cpython/pull/2734 . Some additional 
considerations can be found there.

A further step could require a simplified interface that only involves file 
name, file-like object and compression level, and returns a file-like object to 
read the compressed data from. For example:

def my_compressor(name, fileobj=None, compresslevel=9):
# compression happens here
return filelike_object


This further step is not captured in the pull request, but I can iterate and 
update the diff.

--
components: Library (Lib)
messages: 299017
nosy: insomniacslk
priority: normal
pull_requests: 2903
severity: normal
status: open
title: Add support for custom compressor in tarfile
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com