Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.19.1
Steps to Reproduce
I've found out this while playing with aiorun
lib and sentry_sdk
asyncio
integration.
This relates to python 3.11.X versions since it introduces new signature for create_task
loop method.
Docs prior to py3.10 https://docs.python.org/3.10/library/asyncio-task.html#asyncio.create_task
asyncio.create_task(coro, *, name=None)
Docs for 3.11.X https://docs.python.org/3.10/library/asyncio-task.html#asyncio.create_task
asyncio.create_task(coro, *, name=None, context=None)
Sentry-sdk asyncio source code part:
https://github.com/getsentry/sentry-python/blob/1.19.1/sentry_sdk/integrations/asyncio.py#L31
def _sentry_task_factory(loop, coro):
# type: (Any, Any) -> Any
This should be replaced by
Expected Result
_sentry_task_factory
signature should be replaced by signature bellow
def _sentry_task_factory(loop, coro, *, name=None, context=None):
Actual Result
File "/home/andrei/.cache/pypoetry/virtualenvs/candles-cache-Yse3-3EP-py3.11/lib/python3.11/site-packages/aiorun.py", line 393, in run
loop.run_until_complete(loop.shutdown_asyncgens())
File "uvloop/loop.pyx", line 1487, in uvloop.loop.Loop.run_until_complete
File "/home/andrei/.pyenv/versions/3.11.2/lib/python3.11/asyncio/tasks.py", line 649, in ensure_future
return _ensure_future(coro_or_future, loop=loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrei/.pyenv/versions/3.11.2/lib/python3.11/asyncio/tasks.py", line 670, in _ensure_future
return loop.create_task(coro_or_future)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1431, in uvloop.loop.Loop.create_task
TypeError: patch_asyncio.<locals>._sentry_task_factory() got an unexpected keyword argument 'context'
sys:1: RuntimeWarning: coroutine 'Loop.shutdown_asyncgens' was never awaited
Metadata
Metadata
Assignees
Type
Projects
Status