Skip to content

Replace deprecated asyncio.iscoroutinefunction usage in async_requests.py #265

@askpatrickw

Description

@askpatrickw

Running the latest Azure SDK stack on Python 3.14 emits deprecation warnings from msrest/universal_http/async_requests.py when processing async Bot Framework traffic:

DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated
and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  future = loop.run_in_executor(...)

asyncio.iscoroutinefunction was deprecated in Python 3.12 and will disappear in 3.16, so msrest should switch to inspect.iscoroutinefunction (or asyncio.coroutines.iscoroutinefunction if backward compatibility is required). This warning gets triggered every time a Teams AI bot posts or retrieves messages, making logs noisy and risking future runtime failures once the API is removed.

Please update msrest/universal_http/async_requests.py (and any similar call sites) to use inspect.iscoroutinefunction so the package stays compatible with upcoming Python versions.

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