From a03722f2784f65d499b94bea348f884999922e38 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 12 Jun 2008 14:23:49 +0000 Subject: deprecated mimetools --- Doc/library/mimetools.rst | 3 ++- Lib/mimetools.py | 3 +++ Lib/test/test_mimetools.py | 5 ++++- Lib/test/test_py3kwarn.py | 2 +- Misc/NEWS | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Doc/library/mimetools.rst b/Doc/library/mimetools.rst index 7813867..da34173 100644 --- a/Doc/library/mimetools.rst +++ b/Doc/library/mimetools.rst @@ -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 diff --git a/Lib/mimetools.py b/Lib/mimetools.py index 8c1cc19..5dd5396 100644 --- a/Lib/mimetools.py +++ b/Lib/mimetools.py @@ -5,6 +5,9 @@ import os 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"] diff --git a/Lib/test/test_mimetools.py b/Lib/test/test_mimetools.py index b0b5b01..ed01ede 100644 --- a/Lib/test/test_mimetools.py +++ b/Lib/test/test_mimetools.py @@ -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 diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 768be28..b2dc8cd 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -197,7 +197,7 @@ class TestStdlibRemovals(unittest.TestCase): # 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', diff --git a/Misc/NEWS b/Misc/NEWS index 77eebef..4a93ba7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -84,6 +84,8 @@ Extension Modules 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. -- cgit v0.12