From fae0ed5099de594a9204071d555cb8b76368cbf4 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 27 Aug 2019 11:48:06 +0900 Subject: [PATCH] bpo-37328: remove deprecated HTMLParser.unescape (GH-14186) It is deprecated since Python 3.4. --- Lib/html/parser.py | 8 -------- Lib/test/test_htmlparser.py | 7 ------- .../next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst | 2 ++ 3 files changed, 2 insertions(+), 15 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst diff --git a/Lib/html/parser.py b/Lib/html/parser.py index de81879a631..60830779816 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -9,7 +9,6 @@ import re -import warnings import _markupbase from html import unescape @@ -461,10 +460,3 @@ class HTMLParser(_markupbase.ParserBase): def unknown_decl(self, data): pass - - # Internal -- helper to remove special character quoting - def unescape(self, s): - warnings.warn('The unescape method is deprecated and will be removed ' - 'in 3.5, use html.unescape() instead.', - DeprecationWarning, stacklevel=2) - return unescape(s) diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index 326e34290ff..a2bfb39d16a 100644 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -573,13 +573,6 @@ text for html, expected in data: self._run_check(html, expected) - def test_unescape_method(self): - from html import unescape - p = self.get_collector() - with self.assertWarns(DeprecationWarning): - s = '""""""&#bad;' - self.assertEqual(p.unescape(s), unescape(s)) - def test_broken_comments(self): html = ('' '' diff --git a/Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst b/Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst new file mode 100644 index 00000000000..d91ab1b295d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst @@ -0,0 +1,2 @@ +``HTMLParser.unescape`` is removed. It was undocumented and deprecated +since Python 3.4.