]> granicus.if.org Git - python/commitdiff
bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)
authorInada Naoki <songofacandy@gmail.com>
Tue, 27 Aug 2019 02:48:06 +0000 (11:48 +0900)
committerGitHub <noreply@github.com>
Tue, 27 Aug 2019 02:48:06 +0000 (11:48 +0900)
It is deprecated since Python 3.4.

Lib/html/parser.py
Lib/test/test_htmlparser.py
Misc/NEWS.d/next/Library/2019-06-18-15-31-33.bpo-37328.2PW1-l.rst [new file with mode: 0644]

index de81879a631ac7ea2c4e12c8ac3ffeb376c63418..60830779816a03e61e128801db514b0609fdfa9b 100644 (file)
@@ -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)
index 326e34290ff13b8efef6d02cd2301c1c4f262833..a2bfb39d16a57194772e7d9542d9b4d93775e300 100644 (file)
@@ -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 = '&quot;&#34;&#x22;&quot&#34&#x22&#bad;'
-            self.assertEqual(p.unescape(s), unescape(s))
-
     def test_broken_comments(self):
         html = ('<! not really a comment >'
                 '<! not a comment either -->'
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 (file)
index 0000000..d91ab1b
--- /dev/null
@@ -0,0 +1,2 @@
+``HTMLParser.unescape`` is removed.  It was undocumented and deprecated
+since Python 3.4.