Skip to content

Commit 6c0bb21

Browse files
author
benjamin.peterson
committed
add py3k warnings to rfc822
git-svn-id: http://svn.python.org/projects/python/trunk@64206 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 9f33c7e commit 6c0bb21

5 files changed

Lines changed: 10 additions & 3 deletions

File tree

Doc/library/rfc822.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
.. deprecated:: 2.3
1111
The :mod:`email` package should be used in preference to the :mod:`rfc822`
12-
module. This module is present only to maintain backward compatibility.
12+
module. This module is present only to maintain backward compatibility, and
13+
has been removed in 3.0.
1314

1415
This module defines a class, :class:`Message`, which represents an "email
1516
message" as defined by the Internet standard :rfc:`2822`. [#]_ Such messages

Lib/rfc822.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373

7474
import time
7575

76+
from warnings import warnpy3k
77+
warnpy3k("in 3.x, rfc822 has been removed in favor of the email package")
78+
7679
__all__ = ["Message","AddressList","parsedate","parsedate_tz","mktime_tz"]
7780

7881
_blanklines = ('\r\n', '\n') # Optimization for islast()

Lib/test/test_py3kwarn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class TestStdlibRemovals(unittest.TestCase):
198198
# import side-effect.
199199
all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
200200
'Bastion', 'compiler', 'dircache', 'mimetools', 'fpformat',
201-
'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib')
201+
'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib', 'rfc822')
202202
inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb',
203203
'cdplayer', 'CL', 'cl', 'DEVICE', 'GL',
204204
'gl', 'ERRNO', 'FILE', 'FL', 'flp', 'fl',

Lib/test/test_rfc822.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import rfc822
21
import unittest
32
from test import test_support
43

4+
rfc822 = test_support.import_module("rfc822", deprecated=True)
5+
56
try:
67
from cStringIO import StringIO
78
except ImportError:

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ Extension Modules
8484
Library
8585
-------
8686

87+
- The rfc822 module has been deprecated for removal in 3.0.
88+
8789
- The mimetools module has been deprecated for removal in 3.0.
8890

8991
- The ctypes.byref function now takes an optional second parameter

0 commit comments

Comments
 (0)