Bug 408146 - Script Error - Krita (4.2)
Summary: Script Error - Krita (4.2)
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: 4.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-31 13:23 UTC by James Wright
Modified: 2019-06-02 10:08 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Wright 2019-05-31 13:23:20 UTC
SUMMARY

Script Error - Krita


STEPS TO REPRODUCE
1. Goto Tools > Scripts > Document Tools 
2. Error screen pops up "Script Error - Krita"
3. SyntaxError: invalid syntax (scaletool.py, line 1)

OBSERVED RESULT
Error Message

EXPECTED RESULT
Document Tools Window

SOFTWARE/OS VERSIONS
Windows: 10 (1809)
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

Full Test of error...

SyntaxError
Python 3.6.2: python
Fri May 31 09:18:21 2019

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\documenttools.py in initialize(self=<documenttools.documenttools.DocumentToolsExtension object>)
   31         action.triggered.connect(self.initialize)
   32 
   33     def initialize(self):
   34         self.uidocumenttools = uidocumenttools.UIDocumentTools()
   35         self.uidocumenttools.initialize()
self = <documenttools.documenttools.DocumentToolsExtension object>
self.uidocumenttools = <documenttools.uidocumenttools.UIDocumentTools object>
self.uidocumenttools.initialize = <bound method UIDocumentTools.initialize of <documenttools.uidocumenttools.UIDocumentTools object>>

 C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\uidocumenttools.py in initialize(self=<documenttools.uidocumenttools.UIDocumentTools object>)
   49     def initialize(self):
   50         self.loadDocuments()
   51         self.loadTools()
   52 
   53         self.documentLayout.addWidget(self.widgetDocuments)
self = <documenttools.uidocumenttools.UIDocumentTools object>
self.loadTools = <bound method UIDocumentTools.loadTools of <documenttools.uidocumenttools.UIDocumentTools object>>

 C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\uidocumenttools.py in loadTools(self=<documenttools.uidocumenttools.UIDocumentTools object>)
   83 
   84         for module in modules:
   85             m = importlib.import_module(module['module'])
   86             toolClass = getattr(m, module['klass'])
   87             obj = toolClass(self.mainDialog)
m = <module 'documenttools.tools.canvassizetool.canv...tools\\tools\\canvassizetool\\canvassizetool.py'>
global importlib = <module 'importlib' from 'C:\\Program Files\\Kri...\\python\\python36.zip\\importlib\\__init__.pyc'>
importlib.import_module = <function import_module>
module = {'klass': 'ScaleTool', 'module': 'documenttools.tools.scaletool.scaletool'}

 C:\Program Files\Krita (x64)\importlib\__init__.py in import_module(name='documenttools.tools.scaletool.scaletool', package=None)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap> in _gcd_import(name='documenttools.tools.scaletool.scaletool', package=None, level=0)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap> in _find_and_load(name='documenttools.tools.scaletool.scaletool', import_=<function _gcd_import>)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap> in _find_and_load_unlocked(name='documenttools.tools.scaletool.scaletool', import_=<function _gcd_import>)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap> in _load_unlocked(spec=ModuleSpec(name='documenttools.tools.scaletool.s...\\documenttools\\tools\\scaletool\\scaletool.py'))


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap_external> in exec_module(self=<_frozen_importlib_external.SourceFileLoader object>, module=<module 'documenttools.tools.scaletool.scaletool...\\documenttools\\tools\\scaletool\\scaletool.py'>)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap_external> in get_code(self=<_frozen_importlib_external.SourceFileLoader object>, fullname='documenttools.tools.scaletool.scaletool')


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap_external> in source_to_code(self=<_frozen_importlib_external.SourceFileLoader object>, data=b'/# This script is licensed CC 0 1.0, so that y...          self.strategyComboBox.currentText())\n', path=r'C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\tools\scaletool\scaletool.py', _optimize=-1)


 C:\Program Files\Krita (x64)\<frozen importlib._bootstrap> in _call_with_frames_removed(f=<built-in function compile>, *args=(b'/# This script is licensed CC 0 1.0, so that y...          self.strategyComboBox.currentText())\n', r'C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\tools\scaletool\scaletool.py', 'exec'), **kwds={'dont_inherit': True, 'optimize': -1})

SyntaxError: invalid syntax (scaletool.py, line 1)
    __cause__ = None
    __class__ = <class 'SyntaxError'>
    __context__ = None
    __delattr__ = <method-wrapper '__delattr__' of SyntaxError object>
    __dict__ = {}
    __dir__ = <built-in method __dir__ of SyntaxError object>
    __doc__ = 'Invalid syntax.'
    __eq__ = <method-wrapper '__eq__' of SyntaxError object>
    __format__ = <built-in method __format__ of SyntaxError object>
    __ge__ = <method-wrapper '__ge__' of SyntaxError object>
    __getattribute__ = <method-wrapper '__getattribute__' of SyntaxError object>
    __gt__ = <method-wrapper '__gt__' of SyntaxError object>
    __hash__ = <method-wrapper '__hash__' of SyntaxError object>
    __init__ = <method-wrapper '__init__' of SyntaxError object>
    __init_subclass__ = <built-in method __init_subclass__ of type object>
    __le__ = <method-wrapper '__le__' of SyntaxError object>
    __lt__ = <method-wrapper '__lt__' of SyntaxError object>
    __ne__ = <method-wrapper '__ne__' of SyntaxError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of SyntaxError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of SyntaxError object>
    __repr__ = <method-wrapper '__repr__' of SyntaxError object>
    __setattr__ = <method-wrapper '__setattr__' of SyntaxError object>
    __setstate__ = <built-in method __setstate__ of SyntaxError object>
    __sizeof__ = <built-in method __sizeof__ of SyntaxError object>
    __str__ = <method-wrapper '__str__' of SyntaxError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __suppress_context__ = False
    __traceback__ = <traceback object>
    args = ('invalid syntax', (r'C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\tools\scaletool\scaletool.py', 1, 1, '/# This script is licensed CC 0 1.0, so that you can learn from it.\n'))
    filename = r'C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\tools\scaletool\scaletool.py'
    lineno = 1
    msg = 'invalid syntax'
    offset = 1
    print_file_and_line = None
    text = '/# This script is licensed CC 0 1.0, so that you can learn from it.\n'
    with_traceback = <built-in method with_traceback of SyntaxError object>

The above is a description of an error in a Python program.  Here is
the original traceback:

Traceback (most recent call last):
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\documenttools.py", line 35, in initialize
    self.uidocumenttools.initialize()
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\uidocumenttools.py", line 51, in initialize
    self.loadTools()
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\uidocumenttools.py", line 85, in loadTools
    m = importlib.import_module(module['module'])
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\Program Files\Krita (x64)\share\krita\pykrita\documenttools\tools\scaletool\scaletool.py", line 1
    /# This script is licensed CC 0 1.0, so that you can learn from it.
    ^
SyntaxError: invalid syntax
Comment 1 Halla Rempt 2019-05-31 13:25:13 UTC
Thanks for your report, I can confirm the issue.
Comment 2 Halla Rempt 2019-05-31 13:27:47 UTC
Git commit b1f02c7648de6dbce28e795ae10b8eb41219a7d2 by Boudewijn Rempt.
Committed on 31/05/2019 at 13:27.
Pushed by rempt into branch 'master'.

Fix typo in Documenttools Python plugin

BACKPORT:krita/4.2

M  +1    -1    plugins/python/documenttools/tools/scaletool/scaletool.py

https://invent.kde.org/kde/krita/commit/b1f02c7648de6dbce28e795ae10b8eb41219a7d2
Comment 3 Halla Rempt 2019-06-02 10:08:00 UTC
Git commit 6dc8131e0e3a5e0c7f2c42e6b40a6cd8c7cc7384 by Boudewijn Rempt.
Committed on 02/06/2019 at 09:37.
Pushed by rempt into branch 'krita/4.2'.

Fix typo in Documenttools Python plugin

BACKPORT:krita/4.2
(cherry picked from commit b1f02c7648de6dbce28e795ae10b8eb41219a7d2)

M  +1    -1    plugins/python/documenttools/tools/scaletool/scaletool.py

https://invent.kde.org/kde/krita/commit/6dc8131e0e3a5e0c7f2c42e6b40a6cd8c7cc7384