SUMMARY Starting Krita 5.1.3 on a system with python 3.11 results in error messages on stderr: /usr/lib64/krita-python-libs/krita added to PYTHONPATH krita.scripting: "Traceback (most recent call last):" krita.scripting: " File \"/usr/share/krita/pykrita/scripter/__init__.py\", line 6, in <module>" krita.scripting: " from .scripter import *" krita.scripting: " File \"/usr/share/krita/pykrita/scripter/scripter.py\", line 8, in <module>" krita.scripting: " from . import uicontroller, documentcontroller, debugcontroller" krita.scripting: " File \"/usr/share/krita/pykrita/scripter/debugcontroller.py\", line 6, in <module>" krita.scripting: " from .debugger_scripter import debugger" krita.scripting: " File \"/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py\", line 16, in <module>" krita.scripting: " class Debugger(bdb.Bdb):" krita.scripting: " File \"/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py\", line 86, in Debugger" krita.scripting: " @asyncio.coroutine" krita.scripting: " ^^^^^^^^^^^^^^^^^" krita.scripting: "AttributeError: module 'asyncio' has no attribute 'coroutine'" krita.scripting: "Could not import scripter" krita.scripting: Error loading plugin "scripter" @asyncio.coroutine has been deprecated since python 3.5 and finally removed in 3.11. STEPS TO REPRODUCE 1. Install python 3.11 2. Build scripter's dependencies with python 3.11 3. Build and launch krita OBSERVED RESULT Scripter crashes on startup EXPECTED RESULT Scripter works SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.26.3 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7+KDE patches ADDITIONAL INFORMATION The fix is simply replacing @asyncio.coroutine with the async keyword, but that will break some ancient python versions (3.3 and 3.4).
I'm targeting a Python upgrade to 5.2: https://invent.kde.org/graphics/krita/-/merge_requests/1604 Fixing this would ensure we can safely upgrade the minimum version to at least 3.9, so assigning to myself.
This patch works for me with 3.11 https://github.com/OpenMandrivaAssociation/krita/blob/master/krita-5.1.3-python-3.11.patch Haven't tried with any older versions, but don't see why it wouldn't work. (MR 1604 doesn't have anything related to this, @asyncio.coroutine is still present in 3.11)
(In reply to Bernhard Rosenkränzer from comment #2) > (MR 1604 doesn't have anything related to this, @asyncio.coroutine is still > present in 3.11) I know, I'd not tested with 3.11 as it is clearly stated from the MR. Is it OK if I cherry pick your patches and credit you appropriately?
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1643
Git commit 03931999a82adb72b16796ffea6cb3b19f4ff65c by L. E. Segovia, on behalf of Bernhard Rosenkränzer. Committed on 28/11/2022 at 22:39. Pushed by lsegovia into branch 'krita/5.1'. Fix scripting with python 3.11 See: https://github.com/OpenMandrivaAssociation/krita/commit/0267dc56d5d8a321e4397b9caf1644dd936c6f8e Signed-off-by: L. E. Segovia <amy@amyspark.me> Part-of: <https://invent.kde.org/graphics/krita/-/merge_requests/1643> (cherry picked from commit 648fdf1cbb709dd6f775c6fad5acf543d8aaa533) M +9 -16 plugins/python/scripter/debugger_scripter/debugger.py https://invent.kde.org/graphics/krita/commit/03931999a82adb72b16796ffea6cb3b19f4ff65c