stop using deprecated HTMLParser.unescape#1788
stop using deprecated HTMLParser.unescape#1788mergify[bot] merged 1 commit intopypa:masterfrom methane:patch-1
Conversation
|
Should this type of change require News fragment and test? Note that this change is executed always when this module is imported... |
|
It took me a second to realize how this was different from the current formulation, but it's because as is, I think a changelog entry would be wise, because when people start using Python 3.9, they'll want to know the minimum version of I don't think a separate test for this is necessary. Thanks! |
HTMLParser.unescape is accessed even when unused - this will cause an exception when `HTMLParser.unescape` is removed in Python 3.9.
|
Thanks @methane, I've squashed the current commits and marked this for auto-merge, so it should merge as soon as the CI passes. Glad to have people getting us ahead of the curve on avoiding deprecation warnings / breaking changes. Much better for the versions of |
There was a problem hiding this comment.
I encounter that issue with python 3.9 while installing
python3 -m pip install robotframework-debugger
so this would do the trick
´´´
Collecting tkinterhtml (from robotframework-debugger)
Downloading https://files.pythonhosted.org/packages/37/be/86c2db091f663667686726aa7c45dc5fa198683b018986e6a5854006dbd7/tkinterhtml-0.7.zip (930kB)
100% |████████████████████████████████| 931kB 1.9MB/s
Exception:
File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/py33compat.py", line 54, in
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
AttributeError: 'HTMLParser' object has no attribute 'unescape
´´´
my params:
setuptools-50.3.2
python 3.9.0
pip 9.0.1
|
What version of setuptools do you use? |
|
The file py33compat.py is buggy placing the test for the html module in the bottom of the file probably inside a class where the html module import is hidden and not just after importing html. This is my interpretation as I don't program in python. This incorrect test prevented me in using letsencrypt as it was upgrading itself automatically. ('12/e1/b9a2926a3c5a3fb055b8f85052f5baa890106a0e21b64a977c10affea751/'
|
Summary of changes
HTMLParser.unescape is deprecated since Python 3.4.
Pull Request Checklist