opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

TypeError from opentelemetry.context.contextvars_context in detach

Open hyoinandout opened this issue 5 months ago • 5 comments

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

hyoinandout avatar Aug 29 '24 06:08 hyoinandout