Skip to content

Silent async breakage on Python 3.6 #694

@marco-neumann-by

Description

@marco-neumann-by

Abstract

aiocontextvars is required on Python 3.6 to make async integrations work (e.g. ASGI), but this is only obvious from reading the source code.

Technical Background

Here the aiocontextvars is optionally used under Python 3.6 to setup async-aware context vars. Without the package, async integrations just silently break (e.g. the ASGI integration misses a bunch of metadata, likely because under some conditions the current Hub/client is not found).

Potential Solutions

  • log message: emit a message indicating the missing requirement (maybe only if the debug=True flag is set)
  • warning: same as previous point, but as a Python warning (not logging)
  • optional requirement: add an optional requirement (like async) that under Python 3.6 requires aiocontextvars here.
  • docs: add a note to the integration docs

Refs

#289, #293

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions