How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.58.0
Steps to Reproduce
On Python 3.14.4, asyncio.iscoroutinefunction is deprecated in favour of inspect.iscoroutinefunction.
https://github.com/python/cpython/blob/2fdccb3f88603cb72d311ca304ab7fcf9df12d00/Lib/asyncio/coroutines.py#L20-L27
This raises a warning when using FastAPI's integration, in both sentry_sdk/integrations/starlette.py and sentry_sdk/integrations/fastapi.py
I manually converted them to use inspect in my venvs site package and the warning disappeared as expected. I have not checked for all usage of asyncio.iscoroutinefunction.
Reproduction using pytest
# main.py
from fastapi import FastAPI
import sentry_sdk
from sentry_sdk.integrations.fastapi import FastApiIntegration
sentry_sdk.init(
dsn="valid-dsn",
integrations=[FastApiIntegration()],
)
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
# test_main.py
from main import app
from fastapi.testclient import TestClient
client = TestClient(app)
def test_app():
response = client.get("/")
assert response.status_code == 200
Package Version
-------------------- ---------
annotated-doc 0.0.4
annotated-types 0.7.0
anyio 4.13.0
certifi 2026.2.25
click 8.3.2
dnspython 2.8.0
email-validator 2.3.0
fastapi 0.136.0
fastapi-cli 0.0.24
fastapi-cloud-cli 0.17.0
fastar 0.11.0
h11 0.16.0
httpcore 1.0.9
httptools 0.7.1
httpx 0.28.1
idna 3.11
iniconfig 2.3.0
jinja2 3.1.6
markdown-it-py 4.0.0
markupsafe 3.0.3
mdurl 0.1.2
packaging 26.1
pluggy 1.6.0
pydantic 2.13.1
pydantic-core 2.46.1
pydantic-extra-types 2.11.1
pydantic-settings 2.13.1
pygments 2.20.0
pytest 9.0.3
python-dotenv 1.2.2
python-multipart 0.0.26
pyyaml 6.0.3
rich 15.0.0
rich-toolkit 0.19.7
rignore 0.7.6
sentry-sdk 2.58.0
shellingham 1.5.4
starlette 1.0.0
typer 0.24.1
typing-extensions 4.15.0
typing-inspection 0.4.2
urllib3 2.6.3
uvicorn 0.44.0
uvloop 0.22.1
watchfiles 1.1.1
websockets 16.0
Expected Result
No warnings when using integrations.
Actual Result
================================================== warnings summary ==================================================
.venv/lib/python3.14/site-packages/sentry_sdk/integrations/starlette.py:427
.venv/lib/python3.14/site-packages/sentry_sdk/integrations/starlette.py:427
.venv/lib/python3.14/site-packages/sentry_sdk/integrations/starlette.py:427
.venv/lib/python3.14/site-packages/sentry_sdk/integrations/starlette.py:427
/home/cooper/scratch/sentry-python-repro/.venv/lib/python3.14/site-packages/sentry_sdk/integrations/starlette.py:427: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
return asyncio.iscoroutinefunction(obj) or (
.venv/lib/python3.14/site-packages/sentry_sdk/integrations/fastapi.py:76
/home/cooper/scratch/sentry-python-repro/.venv/lib/python3.14/site-packages/sentry_sdk/integrations/fastapi.py:76: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
and not asyncio.iscoroutinefunction(dependant.call)
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.58.0
Steps to Reproduce
On Python 3.14.4,
asyncio.iscoroutinefunctionis deprecated in favour ofinspect.iscoroutinefunction.https://github.com/python/cpython/blob/2fdccb3f88603cb72d311ca304ab7fcf9df12d00/Lib/asyncio/coroutines.py#L20-L27
This raises a warning when using FastAPI's integration, in both
sentry_sdk/integrations/starlette.pyandsentry_sdk/integrations/fastapi.pyI manually converted them to use
inspectin myvenvs site package and the warning disappeared as expected. I have not checked for all usage ofasyncio.iscoroutinefunction.Reproduction using
pytestExpected Result
No warnings when using integrations.
Actual Result