Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 795309 - app-misc/anki-2.1.15: runtime error with Python 3.9, no error with Python 3.8
Summary: app-misc/anki-2.1.15: runtime error with Python 3.9, no error with Python 3.8
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2021-06-11 02:02 UTC by Austin Ray
Modified: 2021-06-12 09:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,6.42 KB, text/plain)
2021-06-11 02:02 UTC, Austin Ray
Details
backtrace.txt (backtrace.txt,1.35 KB, text/plain)
2021-06-11 02:03 UTC, Austin Ray
Details
anki-2.1.15-unescape.patch (anki-2.1.15-unescape.patch,474 bytes, patch)
2021-06-11 02:05 UTC, Austin Ray
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Ray 2021-06-11 02:02:35 UTC
Created attachment 715194 [details]
emerge --info

anki-2.1.15 uses a deprecated, undocumented method available in Python 3.8[0] and removed in Python 3.9[1]. Upstream has fixed the issue in later releases; however, anki-2.1.15 pre-dates Python 3.9 and throws a runtime error (see backtrace.txt) when using Python 3.9. Python 3.8 runs without issue.

Steps to reproduce:
 1. Create card with type "Basic (type in the answer)"
 2. Review new card and submit answer
 3. Pop-up with backtrace appears (see backtrace.txt)

[0] https://github.com/python/cpython/blob/4844abdd700120120fc76c29d911bcb547700baf/Lib/html/parser.py#L466
[1] https://bugs.python.org/issue37328
Comment 1 Austin Ray 2021-06-11 02:03:08 UTC
Created attachment 715197 [details]
backtrace.txt
Comment 2 Austin Ray 2021-06-11 02:05:08 UTC
Created attachment 715200 [details, diff]
anki-2.1.15-unescape.patch

Added patch that replaces the removed method with its suggested replacement.
Comment 3 Larry the Git Cow gentoo-dev 2021-06-12 09:25:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=267c5a6cdfd2d0e3839118d49598e92ac074d7b0

commit 267c5a6cdfd2d0e3839118d49598e92ac074d7b0
Author:     Austin Ray <austin@austinray.io>
AuthorDate: 2021-06-11 15:10:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-12 09:25:48 +0000

    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>

 app-misc/anki/{anki-2.1.15.ebuild => anki-2.1.15-r1.ebuild} |  1 +
 app-misc/anki/files/anki-2.1.15-unescape.patch              | 13 +++++++++++++
 2 files changed, 14 insertions(+)