Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bleach is deprecated, html5lib unmaintained #14316

Open
pllim opened this issue Jan 25, 2023 · 0 comments
Open

bleach is deprecated, html5lib unmaintained #14316

pllim opened this issue Jan 25, 2023 · 0 comments

Comments

@pllim
Copy link
Member

pllim commented Jan 25, 2023

As per this announcement (repeated below so one less click for you):

Summary

As of now, Bleach is deprecated.

We will continue to support Bleach:

  • security updates
  • support for new Python versions
  • fixes for egregious bugs

I figure that's one release a year or something like that.

Why?

Bleach sits on top of--and heavily relies on--html5lib which is no longer in active development. It is increasingly difficult to maintain Bleach in that context and I think it's nuts to build a security library on top of a library that's not in active development. There are some options (switch to something else, take over html5lib, etc), I don't particularly like any of them. I think instead, someone new should explore the options with a brand new library and a fresh start.

How does this affect astropy?

From our own installation doc:

  • html5lib: To read astropy.table.Table objects from HTML files using the pandas reader.
  • bleach: Used to sanitize text when disabling HTML escaping in the astropy.table.Table HTML writer.

Affected code:

if method == "bleach_clean":

method = "escape_xml" if col_escaped else "bleach_clean"

'html5lib'. html5lib is a highly lenient parser and therefore

if not _HAS_LXML and _HAS_HTML5LIB and _HAS_BS4:
read_kwargs["flavor"] = "bs4"

Given both are optional dependencies, I think we can remove them but it would be API change and a lost of some features.

Should we wait and see how this plays out upstream? But how long?

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

No branches or pull requests

1 participant