]> granicus.if.org Git - python/commitdiff
rename HTMLParser to html.parser, htmlentitydefs to html.entities
authorFred Drake <fdrake@acm.org>
Sat, 17 May 2008 20:30:04 +0000 (20:30 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 17 May 2008 20:30:04 +0000 (20:30 +0000)
(http://bugs.python.org/issue2882)

Lib/html/__init__.py [new file with mode: 0644]
Lib/html/entities.py [moved from Lib/htmlentitydefs.py with 100% similarity]
Lib/html/parser.py [moved from Lib/HTMLParser.py with 100% similarity]
Lib/lib-old/HTMLParser.py [new file with mode: 0644]
Lib/lib-old/htmlentitydefs.py [new file with mode: 0644]
Lib/test/test_py3kwarn.py
Misc/NEWS

diff --git a/Lib/html/__init__.py b/Lib/html/__init__.py
new file mode 100644 (file)
index 0000000..196d378
--- /dev/null
@@ -0,0 +1 @@
+# This directory is a Python package.
similarity index 100%
rename from Lib/htmlentitydefs.py
rename to Lib/html/entities.py
similarity index 100%
rename from Lib/HTMLParser.py
rename to Lib/html/parser.py
diff --git a/Lib/lib-old/HTMLParser.py b/Lib/lib-old/HTMLParser.py
new file mode 100644 (file)
index 0000000..ae42e0f
--- /dev/null
@@ -0,0 +1,8 @@
+from warnings import warnpy3k
+
+warnpy3k(("The HTMLParser module has been renamed to html.parser"
+          " in Python 3.0"), stacklevel=2)
+
+from sys import modules
+import html.parser
+modules["HTMLParser"] = html.parser
diff --git a/Lib/lib-old/htmlentitydefs.py b/Lib/lib-old/htmlentitydefs.py
new file mode 100644 (file)
index 0000000..340b623
--- /dev/null
@@ -0,0 +1,8 @@
+from warnings import warnpy3k
+
+warnpy3k(("The htmlentitydefs module has been renamed to html.entities"
+          " in Python 3.0"), stacklevel=2)
+
+from sys import modules
+import html.entities
+modules["htmlentitydefs"] = html.entities
index 2c8f509e605b0b92f755b27c73d641af8cee34f8..1a65323e4c327e03f30a80081d090f7a40e2fb02 100644 (file)
@@ -209,11 +209,13 @@ class TestStdlibRemovals(unittest.TestCase):
 class TestStdlibRenames(unittest.TestCase):
 
     renames = {'copy_reg': 'copyreg', 'Queue': 'queue',
+               'htmlentitydefs': 'html.entities',
                'SocketServer': 'socketserver',
                'ConfigParser': 'configparser',
                'repr': 'reprlib',
                'FileDialog': 'tkinter.filedialog',
                'FixTk': 'tkinter._fix',
+               'HTMLParser': 'html.parser',
                'ScrolledText': 'tkinter.scrolledtext',
                'SimpleDialog': 'tkinter.simpledialog',
                'Tix': 'tkinter.tix',
index d0a18cd42345e0db0fb6c3fdfb8f1634edf4656d..8ee4d4d9dcd81c64ac962c195b6c58eb894d96d4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -48,6 +48,10 @@ Extension Modules
 Library
 -------
 
+- Issue #2882: The htmlentitydefs module has been renamed to 'html.entities'
+  and HTMLParser has been renamed to 'html.parser'; the old names have been
+  deprecated and will be removed in Python 3.0.
+
 - Issue #961805: Fix Text.edit_modified() in Tkinter.
 
 - Issue #1793: Function ctypes.util.find_msvcrt() added that returns