Skip to content

[3.0.37] DeprecationWarning: There is no current event loop (from asyncio) #1750

Closed
@jdkirkwood

Description

@jdkirkwood

Hi,

233a818 in release 3.0.37 re-introduces asyncio.get_event_loop() which was deprecated and removed in a775996 earlier in the same release.

My Python 3.10 venv fails with prompt-toolkit==3.0.38, but a similar Python 3.8 venv is ok.
Downgrading to prompt-toolkit==3.0.36 allows my Python 3.10 venv to run normally.

(#1726 starts with a different issue but has comments/links directly related to this issue).

2023-04-22 12:34:49,307 18523 WARNING xxx py.warnings: xxx/venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py:955: DeprecationWarning: There is no current event loop
...
  File "zzz/shell.py", line 91, in ipython
    start_ipython(argv=[], user_ns=local_vars)
  File "xxx/venv/lib/python3.10/site-packages/IPython/__init__.py", line 124, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "xxx/venv/lib/python3.10/site-packages/traitlets/config/application.py", line 1043, in launch_instance
    app.start()
  File "xxx/venv/lib/python3.10/site-packages/IPython/terminal/ipapp.py", line 318, in start
    self.shell.mainloop()
  File "xxx/venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 887, in mainloop
    self.interact()
  File "xxx/venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 872, in interact
    code = self.prompt_for_code()
  File "xxx/venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 811, in prompt_for_code
    text = self.pt_app.prompt(
  File "xxx/venv/lib/python3.10/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1035, in prompt
    return self.app.run(
  File "xxx/venv/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 955, in run
    loop = asyncio.get_event_loop()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions