Skip to content
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

Getting RuntimeError: Event loop is closed #13

Closed
Thinura660 opened this issue Aug 14, 2022 · 4 comments
Closed

Getting RuntimeError: Event loop is closed #13

Thinura660 opened this issue Aug 14, 2022 · 4 comments

Comments

@Thinura660
Copy link

[root@archlinux lib]# python3 airstatus.py
/usr/lib/airstatus.py:59: DeprecationWarning: There is no current event loop
loop = get_event_loop()
Traceback (most recent call last):
File "/usr/lib/airstatus.py", line 147, in
run()
File "/usr/lib/airstatus.py", line 132, in run
data = get_data()
File "/usr/lib/airstatus.py", line 68, in get_data
raw = get_data_hex()
File "/usr/lib/airstatus.py", line 60, in get_data_hex
a = loop.run_until_complete(get_device())
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/usr/lib/airstatus.py", line 43, in get_device
devices = await discover()
File "/usr/lib/python3.10/site-packages/bleak/backends/scanner.py", line 116, in discover
async with cls(**kwargs) as scanner:
File "/usr/lib/python3.10/site-packages/bleak/backends/scanner.py", line 96, in aenter
await self.start()
File "/usr/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 137, in start
self._stop = await manager.active_scan(
File "/usr/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 384, in active_scan
reply = await self._bus.call(
File "/usr/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 303, in call
self._call(msg, reply_handler)
File "/usr/lib/python3.10/site-packages/dbus_next/message_bus.py", line 588, in _call
self.send(msg)
File "/usr/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 326, in send
self._writer.schedule_write(msg, future)
File "/usr/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 85, in schedule_write
self.loop.add_writer(self.fd, self.write_callback)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 341, in add_writer
self._add_writer(fd, callback, *args)
File "/usr/lib/python3.10/asyncio/selector_events.py", line 290, in _add_writer
self._check_closed()
File "/usr/lib/python3.10/asyncio/base_events.py", line 515, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@jakobstoeckl
Copy link

I have the same issue 2

@mrsteve0924
Copy link

i updated python-dbus-fast to version 1.75 from 1.14 and it seems to work now

@ssergiienko
Copy link

Just want to confirm that everything works without any issues with AirPods2 Pro and this version of packages

community/python-async-timeout  4.0.2-1
community/python-bleak          0.19.5-1
community/python-dbus-fast      1.84.2-1
extra/python-pyasn1             0.4.8-7
extra/python-pyasn1-modules     0.2.8-6
extra/python-service-identity   21.1.0-4

@mrsteve0924
Copy link

there was a pull request to address airpods2 pro, but it doesnt look like it was merged.
#16

but otherwise this works for me with my airpods2 with these versions of python packages you listed. but there are others who still report they have issues getting it to work.

@Thinura660 Thinura660 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
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

4 participants