Skip to content

TypeError from opentelemetry.context.contextvars_context in detach #4163

@hyoinandout

Description

@hyoinandout

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions