Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [ISSUE] [CLOSED] anki broken with Python 3.12
Date: Thu, 12 Oct 2023 21:57:25 +0200	[thread overview]
Message-ID: <20231012195725.zf6nPSJGUYTptAlgmDM9D8UVU2ik1xRwswrMwbCAhaA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-46613@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

Closed issue by virinci on void-packages repository

https://github.com/void-linux/void-packages/issues/46613

Description:
### Is this a new report?

Yes

### System Info

Void 6.5.6_1 x86_64

### Package(s) Affected

anki-2.1.15_6

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

I made a PR <https://github.com/ankitects/anki/pull/2723> (merged) to fix this issue in the `main` branch.
Additionally, this error can be fixed by applying the following patch to the current version packaged by Void Linux.
```patch
diff -Naurp0 a/anki/mpv.py b/anki/mpv.py
--- a/anki/mpv.py	2023-10-11 17:27:45.701979037 +0000
+++ b/anki/mpv.py	2023-10-11 17:27:07.376263916 +0000
@@ -39 +39 @@ import inspect
-from distutils.spawn import find_executable # pylint: disable=import-error,no-name-in-module
+from shutil import which
@@ -68 +68 @@ class MPVBase:
-    executable = find_executable("mpv")
+    executable = which("mpv")
```

### Expected behaviour

`anki` command should open the Anki application.

### Actual behaviour

The `anki` command fails because `distutils` Python module was deprecated in Python 3.10 and it was removed in Python 3.12. It fails with the following error:

```
$ anki
Traceback (most recent call last):
  File "/usr/bin/anki", line 6, in <module>
    import aqt
  File "/usr/share/anki/aqt/__init__.py", line 4, in <module>
    from anki import version as _version
  File "/usr/share/anki/anki/__init__.py", line 14, in <module>
    from anki.storage import Collection
  File "/usr/share/anki/anki/storage.py", line 13, in <module>
    from anki.collection import _Collection
  File "/usr/share/anki/anki/collection.py", line 26, in <module>
    from anki.sound import stripSounds
  File "/usr/share/anki/anki/sound.py", line 89, in <module>
    from anki.mpv import MPV, MPVBase
  File "/usr/share/anki/anki/mpv.py", line 39, in <module>
    from distutils.spawn import find_executable # pylint: disable=import-error,no-name-in-module
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'
```

### Steps to reproduce

1. Execute the command `anki` in terminal.

      reply	other threads:[~2023-10-12 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 17:39 [ISSUE] " virinci
2023-10-12 19:57 ` ahesford [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231012195725.zf6nPSJGUYTptAlgmDM9D8UVU2ik1xRwswrMwbCAhaA@z \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).