diff --git a/beets/importer.py b/beets/importer.py index e97b0a75c..68d5f3d5d 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -1034,8 +1034,8 @@ class ArchiveImportTask(SentinelImportTask): cls._handlers = [] from zipfile import is_zipfile, ZipFile cls._handlers.append((is_zipfile, ZipFile)) - from tarfile import is_tarfile, TarFile - cls._handlers.append((is_tarfile, TarFile)) + import tarfile + cls._handlers.append((tarfile.is_tarfile, tarfile.open)) try: from rarfile import is_rarfile, RarFile except ImportError: diff --git a/docs/changelog.rst b/docs/changelog.rst index 3f2890913..21cbd1217 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -124,6 +124,8 @@ New features: separators to support path queries. Thanks to :user:`nmeum`. :bug:`3567` +* ``beet import`` now handles tar archives with bzip2 or gzip compression. + :bug:`3606` Fixes: diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index b66920d96..724afc80a 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -212,7 +212,7 @@ The ``-p`` option makes beets print out filenames of matched items, which might be useful for piping into other Unix commands (such as `xargs`_). Similarly, the ``-f`` option lets you specify a specific format with which to print every album or track. This uses the same template syntax as beets' :doc:`path formats -`. For example, the command ``beet ls -af '$album: $tracktotal' +`. For example, the command ``beet ls -af '$album: $albumtotal' beatles`` prints out the number of tracks on each Beatles album. In Unix shells, remember to enclose the template argument in single quotes to avoid environment variable expansion.