Skip to content

bleach is deprecated upstream; consider nh3 for HTML sanitization #9974

Open

Description

@presendapp

Disclosure first: I'm the developer of Presend, a small tool that checks package installs. I noticed this while going through dependency manifests in AI-tooling repos.

pyproject.toml lists bleach as a dependency. Bleach's maintainers announced its deprecation in 2023, and PyPI now flags it as "Development Status :: 7 - Inactive" (latest 6.4.0). In Label Studio, bleach sits on the HTML sanitization path, which is exactly where an actively maintained library matters.

The usual replacement is nh3, the Python binding for the Rust ammonia sanitizer. It's maintained, fast, and covers the allowlist-based cleaning bleach is typically used for; the switch is usually local to a helper or two.

Question: is bleach still on a user-facing path (task data, labeling configs), or only in a few internal places? Happy to help with a PR if that's useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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