]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
add py3k warnings to rfc822
authorBenjamin Peterson <benjamin@python.org>
Thu, 12 Jun 2008 22:33:06 +0000 (22:33 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 12 Jun 2008 22:33:06 +0000 (22:33 +0000)
Doc/library/rfc822.rst
Lib/rfc822.py
Lib/test/test_py3kwarn.py
Lib/test/test_rfc822.py
Misc/NEWS

index 37fef78f1ce2f061705b9342702279275bf23b45..4c938f5138d985a615e89b77669bc7196a1e6f45 100644 (file)
@@ -9,7 +9,8 @@
 
 .. deprecated:: 2.3
    The :mod:`email` package should be used in preference to the :mod:`rfc822`
-   module.  This module is present only to maintain backward compatibility.
+   module.  This module is present only to maintain backward compatibility, and
+   has been removed in 3.0.
 
 This module defines a class, :class:`Message`, which represents an "email
 message" as defined by the Internet standard :rfc:`2822`. [#]_  Such messages
index 14cc7297f1dc0f829dd4f63de9051096defdd7e1..4382a51b70d30ebdd4130db99cfeccc0114edc32 100644 (file)
@@ -73,6 +73,9 @@ There are also some utility functions here.
 
 import time
 
+from warnings import warnpy3k
+warnpy3k("in 3.x, rfc822 has been removed in favor of the email package")
+
 __all__ = ["Message","AddressList","parsedate","parsedate_tz","mktime_tz"]
 
 _blanklines = ('\r\n', '\n')            # Optimization for islast()
index b2dc8cd9b35f6203c9b874cff05be6bcb95803ef..a289cc765db2a447bd0011ed6cb9c2eddcfe9827 100644 (file)
@@ -198,7 +198,7 @@ class TestStdlibRemovals(unittest.TestCase):
     # import side-effect.
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
                         'Bastion', 'compiler', 'dircache', 'mimetools', 'fpformat',
-                        'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib')
+                        'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib', 'rfc822')
     inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb',
                                      'cdplayer', 'CL', 'cl', 'DEVICE', 'GL',
                                      'gl', 'ERRNO', 'FILE', 'FL', 'flp', 'fl',
index 197887d4aa939f063778c0f61bc305f26219749e..afbc984c87a4e265c7d231e421bb499888942a79 100644 (file)
@@ -1,7 +1,8 @@
-import rfc822
 import unittest
 from test import test_support
 
+rfc822 = test_support.import_module("rfc822", deprecated=True)
+
 try:
     from cStringIO import StringIO
 except ImportError:
index 5bd09deea6026d047dc5ce597b4e766539b02d04..2481de3408531eb0e6554ca7806c0349a0e079e3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -84,6 +84,8 @@ Extension Modules
 Library
 -------
 
+- The rfc822 module has been deprecated for removal in 3.0.
+
 - The mimetools module has been deprecated for removal in 3.0.
 
 - The ctypes.byref function now takes an optional second parameter