diffoscope 166: Test suite errors with guix and python 3.8
The switch to magic.Magic causes test suite errors and failures building diffoscope 166 on guix using python 3.8. Full log attached. [qsi38wmgnkvs2lqx36n7p99540skr2-diffoscope-166.drv.bz2](/uploads/b7e06a81fae6821938177d70905ed9fa/qsi38wmgnkvs2lqx36n7p99540skr2-diffoscope-166.drv.bz2) Reverting commit c72c30f29ea3760eb4c785644dc7cd4c26833740 works around the issue. Most of the errors are similar to the following: ``` ============================= test session starts ============================== platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1 rootdir: /tmp/guix-build-diffoscope-166.drv-0/source, inifile: pytest.ini collected 462 items ... tests/comparators/test_rpm.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ diffoscope/comparators/utils/specialize.py:54: in specialize if try_recognize(file, cls, cls.recognizes): diffoscope/comparators/utils/specialize.py:37: in try_recognize if not recognizes(file): diffoscope/comparators/utils/file.py:154: in recognizes file.magic_file_type, diffoscope/comparators/utils/file.py:308: in magic_file_type self._magic_file_type = File.guess_file_type(self.path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'diffoscope.comparators.utils.file.File'> path = '/tmp/guix-build-diffoscope-166.drv-0/source/tests/data/test1.rpm' @classmethod def guess_file_type(cls, path): if not hasattr(cls, "_mimedb"): > cls._mimedb = magic.Magic() E TypeError: __init__() missing 1 required positional argument: 'ms' diffoscope/comparators/utils/file.py:73: TypeError ============ 43 failed, 35 passed, 58 skipped, 326 errors in 39.26s ============ command "python" "-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test" failed with status 1 ```
issue