classification
Title: html.unescape does not work as per documentation
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: cardin, docs@python, ezio.melotti, xtreak
Priority: normal Keywords: easy

Created on 2017-10-25 02:46 by cardin, last changed 2018-10-02 00:49 by ezio.melotti. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9662 merged ezio.melotti, 2018-10-02 00:28
PR 9663 merged miss-islington, 2018-10-02 00:35
PR 9664 merged miss-islington, 2018-10-02 00:35
Messages (6)
msg304957 - (view) Author: Cardin (cardin) Date: 2017-10-25 02:46
html.unescape(s)
Convert all named and numeric character references (e.g. >, >, &x3e;)

But running this gives:
>>> html.unescape('>, >, &x3e;')
'>, >, &x3e;'
msg326329 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2018-09-25 07:16
Thanks for the report. The relevant regex to is at https://github.com/python/cpython/blob/f6c8007a29b95b3ea3ca687a9b4924769a696328/Lib/html/__init__.py#L118 added with the commit 4a9ee26750aa8cb37b5072b2bb4dd328819febb4 . As far as I can see from the tests I can confirm this is a doc issue. Would you like to propose a PR for this?

The changes have to be done are at below places : 

* https://github.com/python/cpython/blob/f6c8007a29b95b3ea3ca687a9b4924769a696328/Lib/html/__init__.py#L125
* https://github.com/python/cpython/blob/master/Doc/library/html.rst

I am adding @ezio.melotti for a confirmation of the same.

Thanks
msg326837 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2018-10-02 00:34
New changeset 30534cc7172f36092e0002bb7df482edc0d539ce by Ezio Melotti in branch 'master':
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662)
https://github.com/python/cpython/commit/30534cc7172f36092e0002bb7df482edc0d539ce
msg326839 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2018-10-02 00:43
New changeset 27d7f93f633f0163b96d0a95e312f0eb5615abfd by Ezio Melotti (Miss Islington (bot)) in branch '3.7':
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9663)
https://github.com/python/cpython/commit/27d7f93f633f0163b96d0a95e312f0eb5615abfd
msg326840 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2018-10-02 00:44
New changeset 56c102596f01ecbbe5cca6339d2ae16695b083ff by Ezio Melotti (Miss Islington (bot)) in branch '3.6':
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9664)
https://github.com/python/cpython/commit/56c102596f01ecbbe5cca6339d2ae16695b083ff
msg326842 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2018-10-02 00:49
Fixed, thanks for the report!
History
Date User Action Args
2018-10-02 00:49:10ezio.melottisetstatus: open -> closed
versions: + Python 3.7, Python 3.8
messages: + msg326842

keywords: - patch
resolution: fixed
stage: patch review -> resolved
2018-10-02 00:44:36ezio.melottisetmessages: + msg326840
2018-10-02 00:43:58ezio.melottisetmessages: + msg326839
2018-10-02 00:35:12miss-islingtonsetpull_requests: + pull_request9057
2018-10-02 00:35:04miss-islingtonsetpull_requests: + pull_request9056
2018-10-02 00:34:52ezio.melottisetmessages: + msg326837
2018-10-02 00:28:04ezio.melottisetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request9055
2018-10-01 23:56:51ezio.melottisetkeywords: + easy
assignee: docs@python -> ezio.melotti
stage: needs patch
2018-09-25 07:16:24xtreaksetnosy: + ezio.melotti
messages: + msg326329
2018-09-20 13:27:19xtreaksetnosy: + xtreak
2017-10-25 02:46:46cardincreate