The scripter plugin requires Python 3.5 (uses async def/await). Python 3.5 is not backwards compatible with Python 3.4 and aborts the scipter plugin during krita startup on systems with earlier versions of Python 3. Python 3.5 is not available* for install on my distro (OpenSuSE Leap 42.3). This plugin can be modified to run on earlier versions of Python 3 by using @asyncio.coroutine/yield. File to change: inst/share/krita/pykrita/scripter/debugger_scripter/debugger.py Diff: >diff debugger.py debugger_new.py 77c77,79 < async def display(self): --- > > @asyncio.coroutine > def display(self): 82c84 < await asyncio.sleep(0.3) --- > yield asyncio.sleep(0.3) 89,90c91,93 < async def start(self): < await self.display() --- > @asyncio.coroutine > def start(self): > yield self.display() 92c95,96 < async def step(self): --- > @asyncio.coroutine > def step(self): 94c98 < await self.display() --- > yield self.display() 96c100,101 < async def stop(self): --- > @asyncio.coroutine > def stop(self): 99c104 < await self.display() --- > yield self.display() * it can be installed, but it breaks a lot of other installed packages.
Can you please attach the diff (in unified diff format) to the report so I can apply it and push?
Created attachment 109114 [details] Update to python scripter plugin to allow it to run under python 3.4 Patch attached.
Comment on attachment 109114 [details] Update to python scripter plugin to allow it to run under python 3.4 Um... It doesn't apply?
(In reply to Boudewijn Rempt from comment #3) > Comment on attachment 109114 [details] > Update to python scripter plugin to allow it to run under python 3.4 > > Um... It doesn't apply? My patchy grasp of patching? My version is 4.0.0-pre-alpha (git dd1c4cb) I have also run diff in a separate directory, do I need to run it from the inst directory and include the directory structure?
Created attachment 109115 [details] Update to debugger.py in python scripter plugin to allow use under Python versions prior to 3.5 Don't know what the story is with the earlier patch - stray carriage return somewhere affecting the numbering? ~/krita/inst/share/krita/pykrita/scripter/debugger_scripter> diff -u debugger.py debugger_new.py > debugger_python3.4b.patch ~/krita/inst/share/krita/pykrita/scripter/debugger_scripter> cp debugger.py debugger_bak.py ~/krita/inst/share/krita/pykrita/scripter/debugger_scripter> patch < debugger_python3.4b.patch patching file debugger.py ~/krita/inst/share/krita/pykrita/scripter/debugger_scripter> diff debugger.py debugger_new.py ~/krita/inst/share/krita/pykrita/scripter/debugger_scripter> If this doesn't work, please point me to the phabricator (I can't find my way around it) for debugger.py and I'll diff against that.
Tt would be easier to just change the original file and provide the output of "git diff"
(In reply to Boudewijn Rempt from comment #6) > Tt would be easier to just change the original file and provide > the output of "git diff" Can you give me the link to the right git repository? I can never find the 4.0 version.
Created attachment 109129 [details] Update to debugger.py in python scripter plugin to allow use under Python versions prior to 3.5 I have downloaded krita 4.0.0 alpha 2 tarball and worked from it. There is an additional carriage return which has probably thrown off earlier patches.
Created attachment 109137 [details] Update to debugger.py in python scripter plugin to allow use under Python versions prior to 3.5 yield causes errors, updated to use yield from
The git source for Krita is here: https://phabricator.kde.org/source/krita/ :-) Sorry for the late reply, I've been sick for a couple of days.
Hey Brendan, I managed to apply your patch. :) One thing though: next time don't rename files, the rename had gotten into the patch. :( How would you like to be known in the commit message?
(In reply to wolthera from comment #11) > Hey Brendan, I managed to apply your patch. :) Woohoo! The most recent one, with yield from I hope. > One thing though: next time don't rename files, the rename had gotten into > the patch. :( Sorry. I was working from a tarball bc I wasn't sure how phabricator worked/what fork had the most recent versions in it. There is another python 3.4 incompatibility in the way that scripter loads the scripts (using module_from_spec) bug report to be filed soon. I'm proposing to add a new file to deal with that rather than include compatibility code in runner.py > How would you like to be known in the commit message? (In reply to wolthera from comment #11) > Hey Brendan, I managed to apply your patch. :) > > One thing though: next time don't rename files, the rename had gotten into > the patch. :( > > How would you like to be known in the commit message?
... So... How would you like to be known in the commit message?
Git commit b360e236011bffa0cc5032d49262a49ef2e073fc by Wolthera van Hövell tot Westerflier, on behalf of Brendan Scott. Committed on 05/12/2017 at 21:51. Pushed by woltherav into branch 'master'. Related: bug 3, bug 5 Thanks Brendan Scott for the patch! M +12 -8 plugins/extensions/pykrita/plugin/plugins/scripter/debugger_scripter/debugger.py https://commits.kde.org/krita/b360e236011bffa0cc5032d49262a49ef2e073fc