From 55e38c2f3280bdefb3f7ad6934777fdd8b790778 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 18 Jun 2019 15:27:37 +0900 Subject: [PATCH 1/2] bpo-37328: remove deprecated HTMLParser.unescape It is deprecated since Python 3.4 --- Lib/html/parser.py | 8 -------- Lib/test/test_htmlparser.py | 7 ------- 2 files changed, 15 deletions(-) diff --git a/Lib/html/parser.py b/Lib/html/parser.py index de81879a631ac7..60830779816a03 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 @@ def handle_pi(self, data): 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 326e34290ff13b..a2bfb39d16a571 100644 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -573,13 +573,6 @@ def test_EOF_in_charref(self): 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 = ('' '' From 6b601a61dd52480d9234ff361903932c111958a3 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 18 Jun 2019 15:31:35 +0900 Subject: [PATCH 2/2] add news --- .../next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst 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 00000000000000..d91ab1b295d371 --- /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. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy