opentelemetry-python
opentelemetry-python copied to clipboard
TypeError from opentelemetry.context.contextvars_context in detach
Describe your environment
Python version: 3.12.4 SDK version: 1.25.0 API version: 1.25.0
What happened?
TypeError from opentelemetry.context.contextvars_context in detach. The function detach expected an instance of Token, but it got None. Thus, it fails to detach context.
Steps to Reproduce
Pass None to _RUNTIME_CONTEXT.detach
Expected Result
This kind of error should be elaborated, without avoiding mypy
Actual Result
TypeError occurs
Additional context
No response
Would you like to implement a fix?
Yes