Skip to content

Remove RequestsDependencyWarning suppression when requests fixes version check #2889

@turbomam

Description

@turbomam

Context

requests 2.32.5 has a hardcoded version check in __init__.py that emits a RequestsDependencyWarning when chardet or charset-normalizer are newer than what it recognizes. This is a requests bug — the versions are within the declared constraints (chardet<6, charset_normalizer<4) but fail the runtime string check.

We have chardet 7.2.0 and charset-normalizer 3.4.6 installed. The warning is cosmetic and harmless — chardet isn't even used unless the use-chardet-on-py3 extra is enabled.

What we did

Added PYTHONWARNINGS="ignore:::requests" to the RUN variable in the Makefile (PR #2888). This suppresses all warnings from the requests module during poetry run commands.

When to remove

Remove the suppression when either:

  • requests releases a version that fixes the hardcoded version check
  • We drop requests as a dependency
  • The chardet/charset-normalizer versions fall back within the hardcoded check's range (unlikely — they only go up)

Monitor: https://github.com/psf/requests/issues (search for "RequestsDependencyWarning")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions