Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(352)

Side by Side Diff: Doc/library/email.rst

Issue 4661: email.parser: impossible to read messages encoded in a different encoding
Patch Set: Created 2 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/email.parser.rst ('k') | Lib/email/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`email` --- An email and MIME handling package 1 :mod:`email` --- An email and MIME handling package
2 =================================================== 2 ===================================================
3 3
4 .. module:: email 4 .. module:: email
5 :synopsis: Package supporting the parsing, manipulating, and generating 5 :synopsis: Package supporting the parsing, manipulating, and generating
6 email messages, including MIME documents. 6 email messages, including MIME documents.
7 .. moduleauthor:: Barry A. Warsaw <barry@python.org> 7 .. moduleauthor:: Barry A. Warsaw <barry@python.org>
8 .. sectionauthor:: Barry A. Warsaw <barry@python.org> 8 .. sectionauthor:: Barry A. Warsaw <barry@python.org>
9 .. Copyright (C) 2001-2007 Python Software Foundation 9 .. Copyright (C) 2001-2010 Python Software Foundation
10 10
11 11
12 The :mod:`email` package is a library for managing email messages, including 12 The :mod:`email` package is a library for managing email messages, including
13 MIME and other :rfc:`2822`\ -based message documents. It is specifically *not* 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 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 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 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 17 possible, supporting in addition to :rfc:`2822`, such MIME-related RFCs as
18 :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, and :rfc:`2231`. 18 :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, and :rfc:`2231`.
19 19
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 | email version | distributed with | compatible with | 85 | email version | distributed with | compatible with |
86 +===============+==============================+=======================+ 86 +===============+==============================+=======================+
87 | :const:`1.x` | Python 2.2.0 to Python 2.2.1 | *no longer supported* | 87 | :const:`1.x` | Python 2.2.0 to Python 2.2.1 | *no longer supported* |
88 +---------------+------------------------------+-----------------------+ 88 +---------------+------------------------------+-----------------------+
89 | :const:`2.5` | Python 2.2.2+ and Python 2.3 | Python 2.1 to 2.5 | 89 | :const:`2.5` | Python 2.2.2+ and Python 2.3 | Python 2.1 to 2.5 |
90 +---------------+------------------------------+-----------------------+ 90 +---------------+------------------------------+-----------------------+
91 | :const:`3.0` | Python 2.4 | Python 2.3 to 2.5 | 91 | :const:`3.0` | Python 2.4 | Python 2.3 to 2.5 |
92 +---------------+------------------------------+-----------------------+ 92 +---------------+------------------------------+-----------------------+
93 | :const:`4.0` | Python 2.5 | Python 2.3 to 2.5 | 93 | :const:`4.0` | Python 2.5 | Python 2.3 to 2.5 |
94 +---------------+------------------------------+-----------------------+ 94 +---------------+------------------------------+-----------------------+
95 | :const:`5.0` | Python 3.0 and Python 3.1 | Python 3.0 to 3.2 |
96 +---------------+------------------------------+-----------------------+
97 | :const:`5.1` | Python 3.2 | Python 3.0 to 3.2 |
98 +---------------+------------------------------+-----------------------+
99
100 Here are the major differences between :mod:`email` version 5.1 and
101 version 5.0:
102
103 * It is once again possible to parse messages containing non-ASCII bytes,
104 and to reproduce such messages if the data containing the non-ASCII
105 bytes is not modified.
106
107 * New functions :func:`message_from_bytes` and :func:`message_from_binary_file`,
108 and new classes :class:`~email.parser.BytesFeedparser` and
109 :class:`~email.parser.BytesParser` allow binary message data to be parsed
110 into model objects.
111
112 * Given bytes input to the model, :meth:`~email.Message.get_payload()` will
113 by default decode a message body that has a
114 :mailheader:`ContentTransferEncoding` of `8bit` using the charset specified
115 in the MIME headers and return the resulting string.
116
117 * :class:`~email.generator.Generator` will convert message bodies that
118 have a :mailheader:`ContentTransferEncoding` of 8bit and a known charset to
119 instead have a :mailheader:`CotnentTransferEncoding` of ``QuotedPrintable``.
120
121 * New function :class:`~email.generator.BytesGenerator` produces bytes
122 as output, preserving any unchanged non-ASCII data that was
123 present in the input used to build the model.
124
125 Here are the major differences between :mod:`email` version 5 and version 3:
126
127 * All operations are on unicode strings. Text inputs must be strings,
128 text outputs are strings. Outputs are limited to the ASCII character
129 set and so can be encoded to ASCII for transmission. Inputs are also
130 limited to ASCII; this is an acknowledged limitation of email 5.0 and
131 means it can only be used to parse email that is 7bit clean.
95 132
96 Here are the major differences between :mod:`email` version 4 and version 3: 133 Here are the major differences between :mod:`email` version 4 and version 3:
97 134
98 * All modules have been renamed according to :pep:`8` standards. For example, 135 * All modules have been renamed according to :pep:`8` standards. For example,
99 the version 3 module :mod:`email.Message` was renamed to :mod:`email.message` in 136 the version 3 module :mod:`email.Message` was renamed to :mod:`email.message` in
100 version 4. 137 version 4.
101 138
102 * A new subpackage :mod:`email.mime` was added and all the version 3 139 * A new subpackage :mod:`email.mime` was added and all the version 3
103 :mod:`email.MIME\*` modules were renamed and situated into the :mod:`email.mim e` 140 :mod:`email.MIME\*` modules were renamed and situated into the :mod:`email.mim e`
104 subpackage. For example, the version 3 module :mod:`email.MIMEText` was renam ed 141 subpackage. For example, the version 3 module :mod:`email.MIMEText` was renam ed
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 :mod:`date` modules. All of these functions have been moved to the 344 :mod:`date` modules. All of these functions have been moved to the
308 :mod:`email.utils` module. 345 :mod:`email.utils` module.
309 346
310 The ``MsgReader`` class/module has been removed. Its functionality is most 347 The ``MsgReader`` class/module has been removed. Its functionality is most
311 closely supported in the :func:`body_line_iterator` function in the 348 closely supported in the :func:`body_line_iterator` function in the
312 :mod:`email.iterators` module. 349 :mod:`email.iterators` module.
313 350
314 .. rubric:: Footnotes 351 .. rubric:: Footnotes
315 352
316 .. [#] Delivery Status Notifications (DSN) are defined in :rfc:`1894`. 353 .. [#] Delivery Status Notifications (DSN) are defined in :rfc:`1894`.
OLDNEW
« no previous file with comments | « Doc/library/email.parser.rst ('k') | Lib/email/__init__.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7