Skip to content

bug: DeprecationWarning: html5lib's sanitizer is deprecated #557

@pllim

Description

@pllim

Describe the bug

Hello. This deprecation has come up in our project's CI as such (full log):

.../astropy/utils/xml/writer.py:195: in <lambda>
    self.xml_escape_cdata = lambda x: bleach.clean(x, **clean_kwargs)
.../bleach/__init__.py:84: in clean
    return cleaner.clean(text)
.../bleach/sanitizer.py:175: in clean
    filtered = BleachSanitizerFilter(
.../bleach/sanitizer.py:273: in __init__
    return super(BleachSanitizerFilter, self).__init__(source, **kwargs)
...
E       DeprecationWarning: html5lib's sanitizer is deprecated;
see https://github.com/html5lib/html5lib-python/issues/443 and
please let us know if Bleach is unsuitable for your needs

As the traceback says, we are already using Bleach (3.2.0).

I asked over at html5lib/html5lib-python#443 (comment) and it was suggested that I open a bug report here. Thank you!

python and bleach versions (please complete the following information):

  • Python Version: 3.8.1
  • Bleach Version: 3.2.0

To Reproduce

Steps to reproduce the behavior: Is the traceback sufficient?

Expected behavior

No deprecation warning, because I am not sure if there is anything I can do about it, except ignoring the warning.

Additional context

Our CI turns deprecation warnings into failures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions