SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** Scripter fails to debug programs with a long stacktrace. STEPS TO REPRODUCE 1. Open any .py file in Scripter 2. Press on Debug button 3. Obtain the error OBSERVED RESULT TypeError Python 3.10.4: /usr/bin/python3 Mon Jul 18 01:34:26 2022 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /usr/share/krita/pykrita/scripter/ui_scripter/actions/debugaction/debugaction.py in debug(self=<scripter.ui_scripter.actions.debugaction.debugaction.DebugAction object>) 31 if self.scripter.uicontroller.invokeAction('save'): 32 self.scripter.uicontroller.setActiveWidget(i18n('Debugger')) 33 self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) 34 widget = self.scripter.uicontroller.findTabWidget(i18n('Debugger')) 35 widget.startDebugger() self = <scripter.ui_scripter.actions.debugaction.debugaction.DebugAction object> self.scripter = <scripter.scripter.ScripterExtension object> self.scripter.debugcontroller = <scripter.debugcontroller.DebugController object> self.scripter.debugcontroller.start = <bound method DebugController.start of <scripter.debugcontroller.DebugController object>> self.scripter.documentcontroller = <scripter.documentcontroller.DocumentController object> self.scripter.documentcontroller.activeDocument = <scripter.document_scripter.document.Document object> /usr/share/krita/pykrita/scripter/debugcontroller.py in start(self=<scripter.debugcontroller.DebugController object>, document=<scripter.document_scripter.document.Document object>) 25 self._debugger.debugprocess.start() 26 loop = asyncio.get_event_loop() 27 loop.run_until_complete(self._debugger.start()) 28 self.updateUIDebugger() 29 loop = <_UnixSelectorEventLoop running=False closed=False debug=False> loop.run_until_complete = <bound method BaseEventLoop.run_until_complete o...ventLoop running=False closed=False debug=False>> self = <scripter.debugcontroller.DebugController object> self._debugger = <scripter.debugger_scripter.debugger.Debugger object> self._debugger.start = <bound method Debugger.start of <scripter.debugger_scripter.debugger.Debugger object>> /usr/lib/python3.10/asyncio/base_events.py in run_until_complete(self=<_UnixSelectorEventLoop running=False closed=False debug=False>, future=<Task finished name='Task-7' coro=<Debugger.star...=TypeError("'coroutine' object is not iterable")>) 644 raise RuntimeError('Event loop stopped before Future completed.') 645 646 return future.result() 647 648 def stop(self): future = <Task finished name='Task-7' coro=<Debugger.star...=TypeError("'coroutine' object is not iterable")> future.result = <built-in method result of _asyncio.Task object> /usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py in start(self=<scripter.debugger_scripter.debugger.Debugger object>) 101 @asyncio.coroutine 102 def start(self): 103 yield from self.display() 104 105 @asyncio.coroutine self = <scripter.debugger_scripter.debugger.Debugger object> self.display = <bound method Debugger.display of <scripter.debugger_scripter.debugger.Debugger object>> /usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py in display(self=<scripter.debugger_scripter.debugger.Debugger object>) 91 if self.applicationq.empty(): 92 # 'yield from' is not available in Python 2. 93 for i in asyncio.sleep(0.3): 94 yield i 95 else: i undefined global asyncio = <module 'asyncio' from '/usr/lib/python3.10/asyncio/__init__.py'> asyncio.sleep = <function sleep> TypeError: 'coroutine' object is not iterable __cause__ = None __class__ = <class 'TypeError'> __context__ = None __delattr__ = <method-wrapper '__delattr__' of TypeError object> __dict__ = {} __dir__ = <built-in method __dir__ of TypeError object> __doc__ = 'Inappropriate argument type.' __eq__ = <method-wrapper '__eq__' of TypeError object> __format__ = <built-in method __format__ of TypeError object> __ge__ = <method-wrapper '__ge__' of TypeError object> __getattribute__ = <method-wrapper '__getattribute__' of TypeError object> __gt__ = <method-wrapper '__gt__' of TypeError object> __hash__ = <method-wrapper '__hash__' of TypeError object> __init__ = <method-wrapper '__init__' of TypeError object> __init_subclass__ = <built-in method __init_subclass__ of type object> __le__ = <method-wrapper '__le__' of TypeError object> __lt__ = <method-wrapper '__lt__' of TypeError object> __ne__ = <method-wrapper '__ne__' of TypeError object> __new__ = <built-in method __new__ of type object> __reduce__ = <built-in method __reduce__ of TypeError object> __reduce_ex__ = <built-in method __reduce_ex__ of TypeError object> __repr__ = <method-wrapper '__repr__' of TypeError object> __setattr__ = <method-wrapper '__setattr__' of TypeError object> __setstate__ = <built-in method __setstate__ of TypeError object> __sizeof__ = <built-in method __sizeof__ of TypeError object> __str__ = <method-wrapper '__str__' of TypeError object> __subclasshook__ = <built-in method __subclasshook__ of type object> __suppress_context__ = False __traceback__ = <traceback object> args = ("'coroutine' object is not iterable",) with_traceback = <built-in method with_traceback of TypeError object> The above is a description of an error in a Python program. Here is the original traceback: Traceback (most recent call last): File "/usr/share/krita/pykrita/scripter/ui_scripter/actions/debugaction/debugaction.py", line 33, in debug self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) File "/usr/share/krita/pykrita/scripter/debugcontroller.py", line 27, in start loop.run_until_complete(self._debugger.start()) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py", line 103, in start yield from self.display() File "/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py", line 93, in display for i in asyncio.sleep(0.3): TypeError: 'coroutine' object is not iterable EXPECTED RESULT Turned on debug mode SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
That's strange -- that is code that only should be executed if Krita is built to use Python 2. Does the appimage work for you?
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
> That's strange -- that is code that only should be executed if Krita is built to use Python 2. Does the appimage work for you? No, I obtained the same error with appimage (5.0.6 version): TypeError Python 3.8.1: /usr/bin/python3 Thu Aug 4 19:31:22 2022 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/ui_scripter/actions/debugaction/debugaction.py in debug(self=<scripter.ui_scripter.actions.debugaction.debugaction.DebugAction object>) 31 if self.scripter.uicontroller.invokeAction('save'): 32 self.scripter.uicontroller.setActiveWidget(i18n('Debugger')) 33 self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) 34 widget = self.scripter.uicontroller.findTabWidget(i18n('Debugger')) 35 widget.startDebugger() self = <scripter.ui_scripter.actions.debugaction.debugaction.DebugAction object> self.scripter = <scripter.scripter.ScripterExtension object> self.scripter.debugcontroller = <scripter.debugcontroller.DebugController object> self.scripter.debugcontroller.start = <bound method DebugController.start of <scripter.debugcontroller.DebugController object>> self.scripter.documentcontroller = <scripter.documentcontroller.DocumentController object> self.scripter.documentcontroller.activeDocument = <scripter.document_scripter.document.Document object> /tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugcontroller.py in start(self=<scripter.debugcontroller.DebugController object>, document=<scripter.document_scripter.document.Document object>) 25 self._debugger.debugprocess.start() 26 loop = asyncio.get_event_loop() 27 loop.run_until_complete(self._debugger.start()) 28 self.updateUIDebugger() 29 loop = <_UnixSelectorEventLoop running=False closed=False debug=False> loop.run_until_complete = <bound method BaseEventLoop.run_until_complete o...ventLoop running=False closed=False debug=False>> self = <scripter.debugcontroller.DebugController object> self._debugger = <scripter.debugger_scripter.debugger.Debugger object> self._debugger.start = <bound method Debugger.start of <scripter.debugger_scripter.debugger.Debugger object>> /tmp/.mount_krita-isMnvT/usr/lib/python3.8/asyncio/base_events.py in run_until_complete(self=<_UnixSelectorEventLoop running=False closed=False debug=False>, future=<Task finished name='Task-1' coro=<Debugger.star...=TypeError("'coroutine' object is not iterable")>) 610 raise RuntimeError('Event loop stopped before Future completed.') 611 612 return future.result() 613 614 def stop(self): future = <Task finished name='Task-1' coro=<Debugger.star...=TypeError("'coroutine' object is not iterable")> future.result = <built-in method result of _asyncio.Task object> /tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py in start(self=<scripter.debugger_scripter.debugger.Debugger object>) 101 @asyncio.coroutine 102 def start(self): 103 yield from self.display() 104 105 @asyncio.coroutine self = <scripter.debugger_scripter.debugger.Debugger object> self.display = <bound method Debugger.display of <scripter.debugger_scripter.debugger.Debugger object>> /tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py in display(self=<scripter.debugger_scripter.debugger.Debugger object>) 91 if self.applicationq.empty(): 92 # 'yield from' is not available in Python 2. 93 for i in asyncio.sleep(0.3): 94 yield i 95 else: i undefined global asyncio = <module 'asyncio' from '/tmp/.mount_krita-isMnvT/usr/lib/python3.8/asyncio/__init__.py'> asyncio.sleep = <function sleep> TypeError: 'coroutine' object is not iterable __cause__ = None __class__ = <class 'TypeError'> __context__ = None __delattr__ = <method-wrapper '__delattr__' of TypeError object> __dict__ = {} __dir__ = <built-in method __dir__ of TypeError object> __doc__ = 'Inappropriate argument type.' __eq__ = <method-wrapper '__eq__' of TypeError object> __format__ = <built-in method __format__ of TypeError object> __ge__ = <method-wrapper '__ge__' of TypeError object> __getattribute__ = <method-wrapper '__getattribute__' of TypeError object> __gt__ = <method-wrapper '__gt__' of TypeError object> __hash__ = <method-wrapper '__hash__' of TypeError object> __init__ = <method-wrapper '__init__' of TypeError object> __init_subclass__ = <built-in method __init_subclass__ of type object> __le__ = <method-wrapper '__le__' of TypeError object> __lt__ = <method-wrapper '__lt__' of TypeError object> __ne__ = <method-wrapper '__ne__' of TypeError object> __new__ = <built-in method __new__ of type object> __reduce__ = <built-in method __reduce__ of TypeError object> __reduce_ex__ = <built-in method __reduce_ex__ of TypeError object> __repr__ = <method-wrapper '__repr__' of TypeError object> __setattr__ = <method-wrapper '__setattr__' of TypeError object> __setstate__ = <built-in method __setstate__ of TypeError object> __sizeof__ = <built-in method __sizeof__ of TypeError object> __str__ = <method-wrapper '__str__' of TypeError object> __subclasshook__ = <built-in method __subclasshook__ of type object> __suppress_context__ = False __traceback__ = <traceback object> args = ("'coroutine' object is not iterable",) with_traceback = <built-in method with_traceback of TypeError object> The above is a description of an error in a Python program. Here is the original traceback: Traceback (most recent call last): File "/tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/ui_scripter/actions/debugaction/debugaction.py", line 33, in debug self.scripter.debugcontroller.start(self.scripter.documentcontroller.activeDocument) File "/tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugcontroller.py", line 27, in start loop.run_until_complete(self._debugger.start()) File "/tmp/.mount_krita-isMnvT/usr/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete return future.result() File "/tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py", line 103, in start yield from self.display() File "/tmp/.mount_krita-isMnvT/usr/share/krita/pykrita/scripter/debugger_scripter/debugger.py", line 93, in display for i in asyncio.sleep(0.3): TypeError: 'coroutine' object is not iterable Also GUI in appimage is very small.
Git commit e2fb1409b1c61aa381aad5b3c9c425a5b108aa88 by Halla Rempt. Committed on 04/08/2022 at 09:49. Pushed by rempt into branch 'master'. Fix syntax error in scripter This makes the scripter incompatible with Python 2, but even the VFX platform now has abandoned Python 2. M +1 -1 plugins/python/scripter/kritapykrita_scripter.desktop https://invent.kde.org/graphics/krita/commit/e2fb1409b1c61aa381aad5b3c9c425a5b108aa88
Git commit 92d043ab5cec57efdd6127979e0f399da4ad1077 by Halla Rempt. Committed on 04/08/2022 at 09:49. Pushed by rempt into branch 'krita/5.1'. Fix syntax error in scripter This makes the scripter incompatible with Python 2, but even the VFX platform now has abandoned Python 2. (cherry picked from commit e2fb1409b1c61aa381aad5b3c9c425a5b108aa88) M +1 -1 plugins/python/scripter/kritapykrita_scripter.desktop https://invent.kde.org/graphics/krita/commit/92d043ab5cec57efdd6127979e0f399da4ad1077
Ah, I misread the comment there...