Bug 387701 - Scripter cannot load files under Python 3.4
Summary: Scripter cannot load files under Python 3.4
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.0 pre-alpha
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 07:30 UTC by Brendan
Modified: 2018-01-25 08:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Allow scripter to load files under Python 3.4 (4.37 KB, patch)
2017-12-08 07:30 UTC, Brendan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan 2017-12-08 07:30:36 UTC
Created attachment 109253 [details]
Allow scripter to load files under Python 3.4

If you try to run a file from scripter it fails to load the file as a module because it uses the new-in-3.5 method importlib.util.module_from_spec. 

I attach a patch to get this load working in Python 3.4.

This patch:
* adds a new file loader34.py, based on the equivalent bootstrap file from Python 3.5; and
* some code to check for Python 3.4 and use the loader from loader34 to load the module
Comment 1 Brendan 2017-12-08 07:57:08 UTC
ps: git diffed patch!
Comment 2 Brendan 2017-12-28 11:58:26 UTC
This has been implemented in the following code review request: https://phabricator.kde.org/D9529
Comment 3 Halla Rempt 2018-01-25 08:57:33 UTC
Git commit 9412304e0ac248aab660bb5421db3cdc8b5dcc6d by Boudewijn Rempt.
Committed on 25/01/2018 at 08:56.
Pushed by rempt into branch 'master'.

Enable scripter to run on Python 3.4 systems

Patch by Brendanbd, thanks!
Differential Revision: https://phabricator.kde.org/D9529

M  +20   -7    plugins/extensions/pykrita/plugin/plugins/scripter/ui_scripter/actions/runaction/runaction.py

https://commits.kde.org/krita/9412304e0ac248aab660bb5421db3cdc8b5dcc6d