Description
livekit 1.1.14 emits a DeprecationWarning on Python 3.14 whenever an RTC callback is registered because livekit/rtc/event_emitter.py calls asyncio.iscoroutinefunction. That API is deprecated in Python 3.14 and slated for removal in Python 3.16; inspect.iscoroutinefunction is the supported replacement.
Reproduction
from livekit.rtc.event_emitter import EventEmitter
emitter = EventEmitter()
emitter.on("event", lambda: None)
Run with Python 3.14 and warnings enabled:
python -W default::DeprecationWarning reproduction.py
Observed warning:
livekit/rtc/event_emitter.py:160: DeprecationWarning: asyncio.iscoroutinefunction is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
Environment
- Python 3.14.0
- livekit 1.1.14
- Linux x86_64
Suggested change
Import iscoroutinefunction from inspect and use it at the callback validation site. A regression test with DeprecationWarning promoted to an error on Python 3.14 would prevent recurrence.
Description
livekit1.1.14 emits aDeprecationWarningon Python 3.14 whenever an RTC callback is registered becauselivekit/rtc/event_emitter.pycallsasyncio.iscoroutinefunction. That API is deprecated in Python 3.14 and slated for removal in Python 3.16;inspect.iscoroutinefunctionis the supported replacement.Reproduction
Run with Python 3.14 and warnings enabled:
python -W default::DeprecationWarning reproduction.pyObserved warning:
Environment
Suggested change
Import
iscoroutinefunctionfrominspectand use it at the callback validation site. A regression test withDeprecationWarningpromoted to an error on Python 3.14 would prevent recurrence.