Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83e9f4c

Browse files
committed
Remove last traces of mimetools.
1 parent b154909 commit 83e9f4c

8 files changed

Lines changed: 20 additions & 43 deletions

File tree

Doc/library/email.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
1111
1212
The :mod:`email` package is a library for managing email messages, including
13-
MIME and other :rfc:`2822`\ -based message documents. It subsumes most of the
14-
functionality in several older standard modules such as :mod:`rfc822`,
15-
:mod:`mimetools`, :mod:`multifile`, and other non-standard packages such as
16-
:mod:`mimecntl`. It is specifically *not* designed to do any sending of email
17-
messages to SMTP (:rfc:`2821`), NNTP, or other servers; those are functions of
18-
modules such as :mod:`smtplib` and :mod:`nntplib`. The :mod:`email` package
19-
attempts to be as RFC-compliant as possible, supporting in addition to
20-
:rfc:`2822`, such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`,
21-
and :rfc:`2231`.
13+
MIME and other :rfc:`2822`\ -based message documents. It is specifically *not*
14+
designed to do any sending of email messages to SMTP (:rfc:`2821`), NNTP, or
15+
other servers; those are functions of modules such as :mod:`smtplib` and
16+
:mod:`nntplib`. The :mod:`email` package attempts to be as RFC-compliant as
17+
possible, supporting in addition to :rfc:`2822`, such MIME-related RFCs as
18+
:rfc:`2045`, :rfc:`2046`, :rfc:`2047`, and :rfc:`2231`.
2219

2320
The primary distinguishing feature of the :mod:`email` package is that it splits
2421
the parsing and generating of email messages from the internal *object model*

Doc/library/http.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ HTTPResponse Objects
445445

446446
.. attribute:: HTTPResponse.msg
447447

448-
A :class:`mimetools.Message` instance containing the response headers.
448+
An :class:`email.message.Message` instance containing the response headers.
449449

450450

451451
.. attribute:: HTTPResponse.version

Doc/library/http.cookiejar.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,9 @@ contained :class:`Cookie` objects.
165165
:mailheader:`Set-Cookie2` headers in the *response* argument, and store cookies
166166
as appropriate (subject to the :meth:`CookiePolicy.set_ok` method's approval).
167167

168-
The *response* object (usually the result of a call to :meth:`urllib2.urlopen`,
169-
or similar) should support an :meth:`info` method, which returns an object with
170-
a :meth:`getallmatchingheaders` method (usually a :class:`mimetools.Message`
171-
instance).
168+
The *response* object (usually the result of a call to
169+
:meth:`urllib2.urlopen`, or similar) should support an :meth:`info` method,
170+
which returns a :class:`email.message.Message` instance.
172171

173172
The *request* object (usually a :class:`urllib2.Request` instance) must support
174173
the methods :meth:`get_full_url`, :meth:`get_host`, :meth:`unverifiable`, and

Doc/library/http.server.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,9 @@ of which this module provides three different variants:
124124

125125
.. attribute:: MessageClass
126126

127-
.. index:: single: Message (in module mimetools)
128-
129-
Specifies a :class:`rfc822.Message`\ -like class to parse HTTP headers.
130-
Typically, this is not overridden, and it defaults to
131-
:class:`mimetools.Message`.
127+
Specifies an :class:`email.message.Message`\ -like class to parse HTTP
128+
headers. Typically, this is not overridden, and it defaults to
129+
:class:`http.client.HTTPMessage`.
132130

133131
.. attribute:: responses
134132

Doc/library/rfc822.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ various end-user mail programs.
132132
Module :mod:`mailbox`
133133
Classes to read various mailbox formats produced by end-user mail programs.
134134

135-
Module :mod:`mimetools`
136-
Subclass of :class:`rfc822.Message` that handles MIME encoded messages.
137-
138135

139136
.. _message-objects:
140137

Doc/library/urllib.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@ High-level interface
3939
however, so it can't be used at those few places where a true built-in file
4040
object is required.)
4141

42-
.. index:: module: mimetools
43-
4442
The :meth:`info` method returns an instance of the class
45-
:class:`mimetools.Message` containing meta-information associated with the
46-
URL. When the method is HTTP, these headers are those returned by the server
47-
at the head of the retrieved HTML page (including Content-Length and
43+
:class:`email.message.Message` containing meta-information associated with
44+
the URL. When the method is HTTP, these headers are those returned by the
45+
server at the head of the retrieved HTML page (including Content-Length and
4846
Content-Type). When the method is FTP, a Content-Length header will be
4947
present if (as is now usual) the server passed back a file length in response
5048
to the FTP retrieval request. A Content-Type header will be present if the
5149
MIME type can be guessed. When the method is local-file, returned headers
5250
will include a Date representing the file's last-modified time, a
5351
Content-Length giving file size, and a Content-Type containing a guess at the
54-
file's type. See also the description of the :mod:`mimetools` module.
52+
file's type.
5553

5654
The :meth:`geturl` method returns the real URL of the page. In some cases, the
5755
HTTP server redirects a client to another URL. The :func:`urlopen` function
@@ -288,7 +286,7 @@ URL Opener objects
288286

289287
Retrieves the contents of *url* and places it in *filename*. The return value
290288
is a tuple consisting of a local filename and either a
291-
:class:`mimetools.Message` object containing the response headers (for remote
289+
:class:`email.message.Message` object containing the response headers (for remote
292290
URLs) or ``None`` (for local URLs). The caller must then open and read the
293291
contents of *filename*. If *filename* is not given and the URL refers to a
294292
local file, the input filename is returned. If the URL is non-local and

Lib/pydoc.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,17 +1903,7 @@ def callback(path, modname, desc):
19031903
# --------------------------------------------------- web browser interface
19041904

19051905
def serve(port, callback=None, completer=None):
1906-
import http.server, mimetools, select
1907-
1908-
# Patch up mimetools.Message so it doesn't break if rfc822 is reloaded.
1909-
class Message(mimetools.Message):
1910-
def __init__(self, fp, seekable=1):
1911-
Message = self.__class__
1912-
Message.__bases__[0].__bases__[0].__init__(self, fp, seekable)
1913-
self.encodingheader = self.get('content-transfer-encoding')
1914-
self.typeheader = self.get('content-type')
1915-
self.parsetype()
1916-
self.parseplist()
1906+
import http.server, email.message, select
19171907

19181908
class DocHandler(http.server.BaseHTTPRequestHandler):
19191909
def send_document(self, title, contents):
@@ -1981,7 +1971,7 @@ def server_activate(self):
19811971

19821972
DocServer.base = http.server.HTTPServer
19831973
DocServer.handler = DocHandler
1984-
DocHandler.MessageClass = Message
1974+
DocHandler.MessageClass = email.message.Message
19851975
try:
19861976
try:
19871977
DocServer(port, callback).serve_until_quit()

Lib/test/test___all__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def test_all(self):
8585
self.check_all("mailbox")
8686
self.check_all("mailcap")
8787
self.check_all("mhlib")
88-
self.check_all("mimetools")
8988
self.check_all("mimetypes")
9089
self.check_all("multifile")
9190
self.check_all("netrc")
@@ -111,7 +110,6 @@ def test_all(self):
111110
self.check_all("random")
112111
self.check_all("re")
113112
self.check_all("reprlib")
114-
self.check_all("rfc822")
115113
self.check_all("rlcompleter")
116114
self.check_all("robotparser")
117115
self.check_all("sched")

0 commit comments

Comments
 (0)