Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[archive] remove _TarFile wrapper class #1834

Closed
bmr-cymru opened this issue Oct 22, 2019 · 0 comments
Closed

[archive] remove _TarFile wrapper class #1834

bmr-cymru opened this issue Oct 22, 2019 · 0 comments

Comments

@bmr-cymru
Copy link
Member

The sos.archive submodule contains a wrapper for the tarfile.TarFile class:

# Compatibility version of the tarfile.TarFile class. This exists to allow
# compatibility with PY2 runtimes that lack the 'filter' parameter to the
# TarFile.add() method. The wrapper class is used on python2.6 and earlier
# only; all later versions include 'filter' and the native TarFile class is
# used directly.
class _TarFile(tarfile.TarFile):

    # Taken from the python 2.7.5 tarfile.py
    def add(self, name, arcname=None, recursive=True,
            exclude=None, filter=None):
        """Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `exclude' is a function that should
           return True for each filename to be excluded. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        """

Since the earliest 2.x release we test with now is Python-2.7 this can now be removed and the module simplified to just rely on the regular TarFile implementation.

bmr-cymru added a commit that referenced this issue Oct 23, 2019
The _TarFile wrapper in sos.archive is only needed for python 2.6
and earlier: remove it since we no longer support this version.

Closes: #1834
Resolves: #1838

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
bmr-cymru added a commit that referenced this issue Oct 23, 2019
The _TarFile wrapper in sos.archive is only needed for python 2.6
and earlier: remove it since we no longer support this version.

Closes: #1834
Resolves: #1838

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant