After python 3.10 support has been enabled for calibre it fails with: * * Running gui * Traceback (most recent call last): File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup.py", line 119, in <module> sys.exit(main()) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup.py", line 104, in main command.run_all(opts) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup/__init__.py", line 203, in run_all self.run_cmd(self, opts) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup/__init__.py", line 195, in run_cmd self.run_cmd(scmd, opts) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup/__init__.py", line 199, in run_cmd cmd.run(opts) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup/gui.py", line 45, in run self.build_forms(summary=opts.summary) File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/setup/gui.py", line 69, in build_forms from calibre.gui2 import build_forms File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/src/calibre/__init__.py", line 19, in <module> from calibre.constants import (iswindows, ismacos, islinux, isfrozen, File "/var/portage/tmp/portage/app-text/calibre-5.16.1-r1/work/calibre-5.16.1/src/calibre/constants.py", line 294, in <module> class Plugins(collections.Mapping): AttributeError: module 'collections' has no attribute 'Mapping' It looks like the import of collections needs to be handled differently for python 3.10. With python 3.9: Python 3.9.12 (main, May 1 2022, 11:38:34) [GCC 11.2.1 20220115] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import Mapping <stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working >>> With python 3.10: Python 3.10.4 (main, May 1 2022, 11:37:06) [GCC 11.2.1 20220115] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import Mapping Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py) >>> Also found this [1] pull request for another application which handles the import conditionally. Hope this helps. [1] https://github.com/mirukana/mirage/pull/274
Just checked the latest release. Here collections and collections.abc are imported unconditionally in src/calibre/constants.py. > import sys, locale, codecs, os, collections, collections.abc
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02222e41386ba064545e4ea056564f39d3161ea3 commit 02222e41386ba064545e4ea056564f39d3161ea3 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2022-05-20 17:46:34 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2022-05-20 17:47:20 +0000 app-text/calibre: disable py3.10 for 5.16.1-r1 Closes: https://bugs.gentoo.org/846551 Signed-off-by: Zac Medico <zmedico@gentoo.org> app-text/calibre/calibre-5.16.1-r1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)