[Python-checkins] r64169 - in python/trunk: Doc/library/mimetools.rst Lib/mimetools.py Lib/test/test_mimetools.py Lib/test/test_py3kwarn.py Misc/NEWS

benjamin.peterson python-checkins at python.org
Thu Jun 12 16:23:49 CEST 2008


Author: benjamin.peterson
Date: Thu Jun 12 16:23:49 2008
New Revision: 64169

Log:
deprecated mimetools

Modified:
   python/trunk/Doc/library/mimetools.rst
   python/trunk/Lib/mimetools.py
   python/trunk/Lib/test/test_mimetools.py
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Doc/library/mimetools.rst
==============================================================================
--- python/trunk/Doc/library/mimetools.rst	(original)
+++ python/trunk/Doc/library/mimetools.rst	Thu Jun 12 16:23:49 2008
@@ -9,7 +9,8 @@
 
 .. deprecated:: 2.3
    The :mod:`email` package should be used in preference to the :mod:`mimetools`
-   module.  This module is present only to maintain backward compatibility.
+   module.  This module is present only to maintain backward compatibility, and
+   it has been removed in 3.x.
 
 .. index:: module: rfc822
 

Modified: python/trunk/Lib/mimetools.py
==============================================================================
--- python/trunk/Lib/mimetools.py	(original)
+++ python/trunk/Lib/mimetools.py	Thu Jun 12 16:23:49 2008
@@ -5,6 +5,9 @@
 import rfc822
 import tempfile
 
+from warnings import warnpy3k
+warnpy3k("in 3.x, mimetools has been removed in favor of the email package")
+
 __all__ = ["Message","choose_boundary","encode","decode","copyliteral",
            "copybinary"]
 

Modified: python/trunk/Lib/test/test_mimetools.py
==============================================================================
--- python/trunk/Lib/test/test_mimetools.py	(original)
+++ python/trunk/Lib/test/test_mimetools.py	Thu Jun 12 16:23:49 2008
@@ -1,7 +1,10 @@
 import unittest
 from test import test_support
 
-import string, StringIO, mimetools
+import string
+import StringIO
+
+mimetools = test_support.import_module("mimetools", deprecated=True)
 
 msgtext1 = mimetools.Message(StringIO.StringIO(
 """Content-Type: text/plain; charset=iso-8859-1; format=flowed

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Thu Jun 12 16:23:49 2008
@@ -197,7 +197,7 @@
     # test.testall not tested as it executes all unit tests as an
     # import side-effect.
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
-                        'Bastion', 'compiler', 'dircache', 'fpformat',
+                        'Bastion', 'compiler', 'dircache', 'mimetools', 'fpformat',
                         'ihooks', 'mhlib', 'statvfs', 'htmllib', 'sgmllib')
     inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb',
                                      'cdplayer', 'CL', 'cl', 'DEVICE', 'GL',

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Thu Jun 12 16:23:49 2008
@@ -84,6 +84,8 @@
 Library
 -------
 
+- The mimetools module has been deprecated for removal in 3.0.
+
 - The ctypes.byref function now takes an optional second parameter
   which allows to specify an offset in bytes for the constructed
   pointer-like object.


More information about the Python-checkins mailing list