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

Do not call HTMLParser.unescape() in Python 3.9 in six #12540

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

radarhere
Copy link
Contributor

Presumably, #11419 will be resolved at some point in the future by upgrading the base image to Python > 3.8. Maybe by #11420, maybe by #12027, maybe by a PR that has yet to be created.

When that happens, 'six' will have a problem.

six.moves.html_parser.HTMLParser().unescape(
fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))

In Python 3.9, 'unescape' was removed from HTMLParser - https://docs.python.org/3/whatsnew/3.9.html#porting-to-python-3-9

The unescape() method in the html.parser.HTMLParser class has been removed (it was deprecated since Python 3.4).

Looking at the 'six' source code, unescape isn't actually called by anything internally. HTMLParser is sure, but that's it. So if the method is gone in Python >= 3.9, then there's no need to continue testing it when Python is upgraded.

Copy link

radarhere is a new contributor to projects/six. The PR must be approved by known contributors before it can be merged.

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

Successfully merging this pull request may close these issues.

1 participant