diff options
author | Austin Ray <austin@austinray.io> | 2021-06-11 11:10:22 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-06-12 09:25:48 +0000 |
commit | 267c5a6cdfd2d0e3839118d49598e92ac074d7b0 (patch) | |
tree | c45ee5d06dff3b979514a3ba9253d68bd21e51d3 /app-misc/anki | |
parent | x11-terms/mlterm: add libxkbcommon dep (diff) | |
download | gentoo-267c5a6cdfd2d0e3839118d49598e92ac074d7b0.tar.gz gentoo-267c5a6cdfd2d0e3839118d49598e92ac074d7b0.tar.bz2 gentoo-267c5a6cdfd2d0e3839118d49598e92ac074d7b0.zip |
app-misc/anki: patch Python 3.9 incompatibility
This commit modifies the existing anki-2.1.15 ebuild with a patch to
replace a deprecated, undocumented method available in Python 3.8[0] but
removed in Python 3.9[1]. Without the patch, anki throws a runtime error
(see bug for more details) as anki 2.1.15 pre-dates Python 3.9.
[0] https://github.com/python/cpython/blob/4844abdd700120120fc76c29d911bcb547700baf/Lib/html/parser.py#L466
[1] https://bugs.python.org/issue37328
Closes: https://bugs.gentoo.org/795309
Signed-off-by: Austin Ray <austin@austinray.io>
Closes: https://github.com/gentoo/gentoo/pull/21200
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-misc/anki')
-rw-r--r-- | app-misc/anki/anki-2.1.15-r1.ebuild (renamed from app-misc/anki/anki-2.1.15.ebuild) | 1 | ||||
-rw-r--r-- | app-misc/anki/files/anki-2.1.15-unescape.patch | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app-misc/anki/anki-2.1.15.ebuild b/app-misc/anki/anki-2.1.15-r1.ebuild index a1b7dc8c2e75..f97f7bb0fbcb 100644 --- a/app-misc/anki/anki-2.1.15.ebuild +++ b/app-misc/anki/anki-2.1.15-r1.ebuild @@ -44,6 +44,7 @@ BDEPEND="test? ( PATCHES=( "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch "${FILESDIR}"/${PN}-2.1.15-mpv-args.patch + "${FILESDIR}"/${PN}-2.1.15-unescape.patch ) src_prepare() { diff --git a/app-misc/anki/files/anki-2.1.15-unescape.patch b/app-misc/anki/files/anki-2.1.15-unescape.patch new file mode 100644 index 000000000000..7b03c8d8e1a3 --- /dev/null +++ b/app-misc/anki/files/anki-2.1.15-unescape.patch @@ -0,0 +1,13 @@ +diff --git a/aqt/reviewer.py b/aqt/reviewer.py +index f01fcbd9f..5aaf26669 100644 +--- a/aqt/reviewer.py ++++ b/aqt/reviewer.py +@@ -359,7 +359,7 @@ Please run Tools>Empty Cards""") + cor = stripHTML(cor) + # ensure we don't chomp multiple whitespace + cor = cor.replace(" ", " ") +- cor = parser.unescape(cor) ++ cor = html.unescape(cor) + cor = cor.replace("\xa0", " ") + cor = cor.strip() + given = self.typedAnswer |