Skip to content

Asyncio error when closing the program #2890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
benvito opened this issue Mar 15, 2024 · 1 comment
Closed

Asyncio error when closing the program #2890

benvito opened this issue Mar 15, 2024 · 1 comment

Comments

@benvito
Copy link

benvito commented Mar 15, 2024

Starting from version 0.21.0, an error began to appear when closing the application, regardless of the complexity of the application
OS: Windows 10 professional
main.py:

import flet as ft

async def main(page: ft.Page):
        page.add(ft.Text("Hello, Flet!"))

ft.app(target=main)

Output when im closing the app:

Traceback (most recent call last):
  File "d:/ProjectsProgramming/IvyTestBuild/app/main.py", line 6, in <module>
    ft.app(target=main)
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\app.py", line 70, in app
    return asyncio.run(
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", 
line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\app.py", line 207, in app_async
    await conn.close()
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\flet_socket_server.py", line 188, in close
    self.__executor.shutdown(wait=False, cancel_futures=True)
TypeError: shutdown() got an unexpected keyword argument 'cancel_futures'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001EB8496F040>
Traceback (most recent call last):
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\ganya\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
@ndonkoHenri
Copy link
Contributor

See this: #2848 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants