Bug#1024469: lib/debian/tests/test_debfile.py::TestDebFile::test_control fails when tar(1) is not GNU tar

Michał Górny mgorny at gentoo.org
Sun Nov 20 06:51:13 GMT 2022


Package: python-debian
Version: 0.1.49

When tar(1) executable is a non-GNU implementation of tar (bsdtar from
libarchive here), test_control fails trying to pass unsupported `--
warning=no-timestamp` option:

```
=============================== FAILURES ===============================
_______________________ TestDebFile.test_control _______________________

self = <debian.tests.test_debfile.TestDebFile object at 0x7fcb65566aa0>
sample_deb = '/tmp/portage/dev-python/python-debian-
0.1.49/temp/test_debfile.cwjvb8xc/test.ar'

    @pytest.mark.skipif(not _dpkg_deb_path, reason="dpkg-deb not
installed")
    def test_control(self, sample_deb):
        # type: (str) -> None
        """ test for control contents equality """
        with os.popen("dpkg-deb -f %s" % sample_deb) as dpkg_deb:
            filecontrol = "".join(dpkg_deb.readlines())
    
        with debfile.DebFile(sample_deb) as deb:
            ctrl = deb.control.get_content("control")
            assert ctrl is not None
>           assert ctrl.decode("utf-8") == filecontrol

[... cut long diff between expcected and "" ...]
deb        = <debian.debfile.DebFile object at 0x7fcb654951b0>
dpkg_deb   = <os._wrap_close object at 0x7fcb65495660>
filecontrol = ''
sample_deb = '/tmp/portage/dev-python/python-debian-
0.1.49/temp/test_debfile.cwjvb8xc/test.ar'
self       = <debian.tests.test_debfile.TestDebFile object at
0x7fcb65566aa0>

lib/debian/tests/test_debfile.py:623: AssertionError
------------------------- Captured stderr call -------------------------
tar: Option --warning=no-timestamp is not supported
Usage:
  List:    tar -tf <archive-filename>
  Extract: tar -xf <archive-filename>
  Create:  tar -cf <archive-filename> [filenames...]
  Help:    tar --help
dpkg-deb: error: tar subprocess returned error exit status 1
```

This is Gentoo Linux/amd64 with libarchive-3.6.1.  GNU tar is available
as `gtar` if you really need it.  I suspect the same problem applies to
*BSD systems.

-- 
Best regards,
Michał Górny



More information about the pkg-python-debian-maint mailing list