Deprecate htmllib and sgmllib for 3.0.
authorGeorg Brandl <georg@python.org>
Sun, 1 Jun 2008 21:19:14 +0000 (21:19 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 1 Jun 2008 21:19:14 +0000 (21:19 +0000)
Doc/library/htmllib.rst
Doc/library/sgmllib.rst
Lib/htmllib.py
Lib/sgmllib.py
Lib/test/test_htmllib.py
Lib/test/test_py3kwarn.py
Lib/test/test_sgmllib.py
Misc/NEWS

index aa07fdb06ae8a7029b6eec91d034c6468ab50896..0fa518e7914e6bb74a9f86c391ae02d53fec8836 100644 (file)
@@ -1,9 +1,12 @@
-
 :mod:`htmllib` --- A parser for HTML documents
 ==============================================
 
 .. module:: htmllib
    :synopsis: A parser for HTML documents.
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The :mod:`htmllib` module has been removed in Python 3.0.
 
 
 .. index::
index c0ef1a2953dfacaf39664818c9193e2a7d7ed05f..93c0cde66a66af6825540e5e67044185657420da 100644 (file)
@@ -1,10 +1,12 @@
-
 :mod:`sgmllib` --- Simple SGML parser
 =====================================
 
 .. module:: sgmllib
    :synopsis: Only as much of an SGML parser as needed to parse HTML.
-
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The :mod:`sgmllib` module has been removed in Python 3.0.
 
 .. index:: single: SGML
 
index 24a2e2f3c71ff45f9649519a81cf46cc99162028..44647dbf026c054c563a78dee19020927cfd5d88 100644 (file)
@@ -4,6 +4,11 @@ See the HTML 2.0 specification:
 http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
 """
 
+from warnings import warnpy3k
+warnpy3k("the htmllib module has been removed in Python 3.0",
+         stacklevel=2)
+del warnpy3k
+
 import sgmllib
 
 from formatter import AS_IS
index b68eb7a62abd769df3f7395fcdfcafa198ca2a9c..e5fbd32fcc8cfddf7a10b6e0aef9261a40be173b 100644 (file)
@@ -9,6 +9,11 @@
 # not supported at all.
 
 
+from warnings import warnpy3k
+warnpy3k("the sgmllib module has been removed in Python 3.0",
+         stacklevel=2)
+del warnpy3k
+
 import markupbase
 import re
 
index a20f43bbf1146c90a7316f84081672ea77a5fe2c..e1f43348b2c32bb1c926009b6724877a394c3c24 100644 (file)
@@ -1,8 +1,8 @@
 import formatter
-import htmllib
 import unittest
 
 from test import test_support
+htmllib = test_support.import_module('htmllib', deprecated=True)
 
 
 class AnchorCollector(htmllib.HTMLParser):
index eed46d1d2431a64bfa1f52f2b80af1bd6fc86b75..664df449b57eda9b131cab7b1c50c5fee1a44a91 100644 (file)
@@ -137,7 +137,7 @@ class TestStdlibRemovals(unittest.TestCase):
     # import side-effect.
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
                         'Bastion', 'compiler', 'dircache', 'fpformat',
-                        'ihooks', 'mhlib', 'statvfs')
+                        'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib')
     inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb',
                                      'cdplayer', 'CL', 'cl', 'DEVICE', 'GL',
                                      'gl', 'ERRNO', 'FILE', 'FL', 'flp', 'fl',
index d9c9ddc2f5da786598dca74854a1cf9179fe6725..34fd7f00ba07a5d4f426d1af1069b11388052750 100644 (file)
@@ -1,8 +1,8 @@
 import pprint
 import re
-import sgmllib
 import unittest
 from test import test_support
+sgmllib = test_support.import_module('sgmllib', deprecated=True)
 
 
 class EventCollector(sgmllib.SGMLParser):
index 155ade0a8dd8855abfb5e2e14148df9502d9c820..f8e2983798cba7ab6854c875ecf2924abc29e42c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -70,8 +70,11 @@ Extension Modules
 Library
 -------
 
-- Issue #3011: locale module alias table was updated to the latest version
-  from the X.org locale.alias file
+- The sgmllib and htmllib modules have been deprecated for removal
+  in Python 3.0.
+
+- Issue #3011: locale module alias table was updated to the latest
+  version from the X.org locale.alias file.
 
 - Issue #1797 (partial fix): ctypes NULL function pointers have a
   False boolean value now.