uriyyo / pycharm-evaluate-async-code

Finally, you can use await in evaluate expression 💪
https://plugins.jetbrains.com/plugin/14476-evaluate-async-code
44 stars 2 forks source link

awaiting a function crashes the debugger #57

Closed sla-te closed 1 year ago

sla-te commented 2 years ago

As soon as I set a breakpoint and evaluate e.g. await asyncio.sleep(1), I get the following error log and from then on stepping does not work anymore.

Exception in callback Task.task_wakeup(<Future finished result=None>)
handle: <Handle Task.task_wakeup(<Future finished result=None>)>
Traceback (most recent call last):
  File "C:\Users\Administrator\.pyenv\pyenv-win\versions\3.10.7\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-1' coro=<BrowserWorker.start_loop() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:125> wait_for=<Future finished result=None> cb=[_run_until_complete_cb() at C:\Users\Administrator\.pyenv\pyenv-win\versions\3.10.7\lib\asyncio\base_events.py:184]> while another task <Task pending name='Task-3' coro=<SolverJob.get_token() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:85>> is being executed.
Exception in callback Task.task_wakeup(<Future finished result=None>)
handle: <Handle Task.task_wakeup(<Future finished result=None>)>
Traceback (most recent call last):
  File "C:\Users\Administrator\.pyenv\pyenv-win\versions\3.10.7\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-2' coro=<BrowserWorker.watch_for_completed_jobs() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:174> wait_for=<Future finished result=None>> while another task <Task pending name='Task-3' coro=<SolverJob.get_token() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:85>> is being executed.
Exception in callback Task.task_wakeup(<Future finished result=None>)
handle: <Handle Task.task_wakeup(<Future finished result=None>)>
Traceback (most recent call last):
  File "C:\Users\Administrator\.pyenv\pyenv-win\versions\3.10.7\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
RuntimeError: Cannot enter into task <Task pending name='Task-6' coro=<Connection.run() running at C:\Users\Administrator\PycharmProjects\project\venv\lib\site-packages\playwright\_impl\_connection.py:226> wait_for=<Future finished result=None>> while another task <Task pending name='Task-3' coro=<SolverJob.get_token() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:85>> is being executed.
attempts
Task was destroyed but it is pending!
task: <Task pending name='Task-2' coro=<BrowserWorker.watch_for_completed_jobs() running at C:\Users\Administrator\PycharmProjects\project\project\work\service.py:174> wait_for=<Future finished result=None>>
Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<Connection.run() running at C:\Users\Administrator\PycharmProjects\project\venv\lib\site-packages\playwright\_impl\_connection.py:226> wait_for=<Future finished result=None>>
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.5.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.5.0
Out[1]: 0
sla-te commented 1 year ago

You can reproduce this by running the async "intro" script from e.g. playwright - https://github.com/microsoft/playwright-python

uriyyo commented 1 year ago

Hi @sla-te, Thanks, I will take a look. This plugin had issues with playwright-python before, need to investigate where the problem is.

uriyyo commented 1 year ago

Hi @sla-te,

Could you please confirm that this issue still exists? New version 1.22 has been released and this issue should be fixed.

uriyyo commented 1 year ago

Hi @sla-te

New version 1.23 has been released. This issue should be fixed now.

Could you please confirm that this issue is no longer present?

sla-te commented 1 year ago

@uriyyo beautiful, yes it works - very much appreciated and good job!

uriyyo commented 1 year ago

Great, thanks