Created attachment 630872 [details] ebuild for dev-python/magicfile I don't know if it's a Python3.8 problem, but I doubt it. Running diffoscope here I get Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/diffoscope/main.py", line 739, in main sys.exit(run_diffoscope(parsed_args)) File "/usr/lib/python3.8/site-packages/diffoscope/main.py", line 691, in run_diffoscope difference = compare_root_paths(path1, path2) File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/compare.py", line 71, in compare_root_paths file1 = specialize(FilesystemFile(path1, container=container1)) File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/specialize.py", line 49, in specialize if try_recognize(file, cls, cls.recognizes): File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/specialize.py", line 36, in try_recognize if not recognizes(file): File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/file.py", line 155, in recognizes file.magic_file_type, File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/file.py", line 284, in magic_file_type self._magic_file_type = File.guess_file_type(self.path) File "/usr/lib/python3.8/site-packages/diffoscope/comparators/utils/file.py", line 93, in guess_file_type return maybe_decode(self._mimedb.from_file(path)) AttributeError: 'Magic' object has no attribute 'from_file' AFIAK the magic module doesn't have a 'from_file' method. My workaround is to install the 'magicfile' module (ebuild attached) and to fix diffoscope by sed -i -e's/import magic/import magicfile as magic/' diffoscope/comparators/utils/file.py which can be done in the src_prepare part of the ebuild.
I'd like to reproduce failure first. Please post your output of: $ emerge --info dev-util/diffoscope diffoscope seems to work fine for me. Also note: diffoscope does not yet have python3_8 compat marking (for no real reason, just nobody added it).
It turned out that I had installed both dev-python/filemagic and dev-python/python-magic which both offer a 'magic' module. Unfortunately, this wasn't flagged by Python, and dev-python/filemagic got precedence over dev-python/python-magic and its 'magic' modules doesn't have a from_file method. Probably, dev-python/filemagic showed by changed or remove from the tree.
Oh, that's a nasty namespace collision. I wonder how one is supposed to deal with it.
I think one overrides another here and both packages should not be installed together: # qfile /usr/lib64/python3.6/site-packages/magic.py /usr/lib64/python3.6/site-packages/magic/__init__.py dev-python/filemagic: /usr/lib64/python3.6/site-packages/magic/__init__.py dev-python/python-magic: /usr/lib64/python3.6/site-packages/magic.py I suggest adding blockers into one another unless there is a way to unambiguosly load needed module.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5eb37ab51998e04cec8c82252ca167cfe8ac5242 commit 5eb37ab51998e04cec8c82252ca167cfe8ac5242 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-04-15 23:20:38 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-04-15 23:21:01 +0000 dev-util/diffoscope: add blocker against dev-python/filemagic dev-python/filemagic conflicts with dev-python/python-magic and takes precedence when loaded with 'import magic.py'. Let's block the incompatible package until it's sorted across these libraries. Reported-by: Helmut Jarausch Bug: https://bugs.gentoo.org/716482 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> dev-util/diffoscope/diffoscope-140-r1.ebuild | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
filemagic is gone now.