https://bugs.kde.org/show_bug.cgi?id=456824

            Bug ID: 456824
           Summary: TypeError in Scripter while attempting to debug
                    program
           Product: krita
           Version: 5.0.2
          Platform: Ubuntu Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Scripting
          Assignee: krita-bugs-n...@kde.org
          Reporter: emilyseville...@gmail.com
  Target Milestone: ---

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

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to