Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/anki/files/, app-misc/anki/
Date: Sat, 12 Jun 2021 09:26:03
Message-Id: 1623489948.267c5a6cdfd2d0e3839118d49598e92ac074d7b0.sam@gentoo
1 commit: 267c5a6cdfd2d0e3839118d49598e92ac074d7b0
2 Author: Austin Ray <austin <AT> austinray <DOT> io>
3 AuthorDate: Fri Jun 11 15:10:22 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 12 09:25:48 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=267c5a6c
7
8 app-misc/anki: patch Python 3.9 incompatibility
9
10 This commit modifies the existing anki-2.1.15 ebuild with a patch to
11 replace a deprecated, undocumented method available in Python 3.8[0] but
12 removed in Python 3.9[1]. Without the patch, anki throws a runtime error
13 (see bug for more details) as anki 2.1.15 pre-dates Python 3.9.
14
15 [0] https://github.com/python/cpython/blob/4844abdd700120120fc76c29d911bcb547700baf/Lib/html/parser.py#L466
16 [1] https://bugs.python.org/issue37328
17
18 Closes: https://bugs.gentoo.org/795309
19
20 Signed-off-by: Austin Ray <austin <AT> austinray.io>
21 Closes: https://github.com/gentoo/gentoo/pull/21200
22 Signed-off-by: Sam James <sam <AT> gentoo.org>
23
24 app-misc/anki/{anki-2.1.15.ebuild => anki-2.1.15-r1.ebuild} | 1 +
25 app-misc/anki/files/anki-2.1.15-unescape.patch | 13 +++++++++++++
26 2 files changed, 14 insertions(+)
27
28 diff --git a/app-misc/anki/anki-2.1.15.ebuild b/app-misc/anki/anki-2.1.15-r1.ebuild
29 similarity index 98%
30 rename from app-misc/anki/anki-2.1.15.ebuild
31 rename to app-misc/anki/anki-2.1.15-r1.ebuild
32 index a1b7dc8c2e7..f97f7bb0fbc 100644
33 --- a/app-misc/anki/anki-2.1.15.ebuild
34 +++ b/app-misc/anki/anki-2.1.15-r1.ebuild
35 @@ -44,6 +44,7 @@ BDEPEND="test? (
36 PATCHES=(
37 "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch
38 "${FILESDIR}"/${PN}-2.1.15-mpv-args.patch
39 + "${FILESDIR}"/${PN}-2.1.15-unescape.patch
40 )
41
42 src_prepare() {
43
44 diff --git a/app-misc/anki/files/anki-2.1.15-unescape.patch b/app-misc/anki/files/anki-2.1.15-unescape.patch
45 new file mode 100644
46 index 00000000000..7b03c8d8e1a
47 --- /dev/null
48 +++ b/app-misc/anki/files/anki-2.1.15-unescape.patch
49 @@ -0,0 +1,13 @@
50 +diff --git a/aqt/reviewer.py b/aqt/reviewer.py
51 +index f01fcbd9f..5aaf26669 100644
52 +--- a/aqt/reviewer.py
53 ++++ b/aqt/reviewer.py
54 +@@ -359,7 +359,7 @@ Please run Tools>Empty Cards""")
55 + cor = stripHTML(cor)
56 + # ensure we don't chomp multiple whitespace
57 + cor = cor.replace(" ", "&nbsp;")
58 +- cor = parser.unescape(cor)
59 ++ cor = html.unescape(cor)
60 + cor = cor.replace("\xa0", " ")
61 + cor = cor.strip()
62 + given = self.typedAnswer