Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 911923

Summary: app-misc/anki-2.1.15-r2: Error when adding note type
Product: Gentoo Linux Reporter: silver_ghost
Component: Current packagesAssignee: Patrick Lauer <patrick>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint, sam, watermanpaint, wgh
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 896566    
Attachments: Patch for compatibility with >=python-3.10

Description silver_ghost 2023-08-08 13:56:12 UTC
This error prevents you from adding new note types completely.

The error arises from removal of some classes from collections module in 3.10. Here[0] are details from the last python version having these classes in place expected by anki:
Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.9.

Steps to Reproduce:
1. Install app-misc/anki-2.1.15-r2
2. Open Application, language English
3. Tools ⇾ Manage Note Types
4. Click Add button
5. Get error:
Error 
An error occurred. Please use Tools > Check Database to see if that fixes the problem. 
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.15 (442df9d6) Python 3.11.4 Qt 5.15.9 PyQt 5.15.9
Platform: Linux
Flags: frz=False ao=False sv=2

Caught exception:
  File "/usr/lib/python3.11/site-packages/aqt/models.py", line 83, in onAdd
    m = AddModel(self.mw, self).get()
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aqt/models.py", line 173, in __init__
    if isinstance(name, collections.Callable):
                        ^^^^^^^^^^^^^^^^^^^^
<class 'AttributeError'>: module 'collections' has no attribute 'Callable'

[0] https://docs.python.org/3.9/library/collections.html

P.S. I couldn't find the Blocks field so I used See Also one.
Comment 1 silver_ghost 2023-08-12 16:30:48 UTC
Created attachment 867723 [details, diff]
Patch for compatibility with >=python-3.10
Comment 2 silver_ghost 2023-08-14 12:38:30 UTC
I suppose https://bugs.gentoo.org/896566 should be reopened too.
Comment 3 Larry the Git Cow gentoo-dev 2024-01-21 10:00:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b9198bdf25bfcdf1dd878e39c202ecae74c6ed2

commit 3b9198bdf25bfcdf1dd878e39c202ecae74c6ed2
Author:     Lucio Sauer <watermanpaint@posteo.net>
AuthorDate: 2024-01-09 03:36:14 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-21 10:00:25 +0000

    app-misc/anki: add 23.12.1
    
    Closes: https://bugs.gentoo.org/914774
    Closes: https://bugs.gentoo.org/911923
    Closes: https://bugs.gentoo.org/782373
    Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 app-misc/anki/Manifest                             | 648 ++++++++++++++
 app-misc/anki/anki-23.12.1.ebuild                  | 955 +++++++++++++++++++++
 .../files/23.12.1/configure-offline-build.patch    |  62 ++
 .../anki/files/23.12.1/ninja-gentoo-setup.patch    |  80 ++
 .../anki/files/23.12.1/no-git-submodule-sync.patch |  67 ++
 app-misc/anki/files/23.12.1/pseudo-venv.patch      | 123 +++
 .../anki/files/23.12.1/remove-formatter-dep.patch  |  11 +
 app-misc/anki/files/23.12.1/remove-yarn-dep.patch  |  68 ++
 app-misc/anki/files/23.12.1/unbundle-sqlite.patch  |  14 +
 .../anki/files/23.12.1/use-system-nextest.patch    |  26 +
 app-misc/anki/metadata.xml                         |  13 +
 11 files changed, 2067 insertions(+)