@@ -60,15 +60,18 @@ list of defects that it can find.
6060Here is the API for the :class: `FeedParser `:
6161
6262
63- .. class :: FeedParser(_factory=email.message.Message, *, policy=policy.default )
63+ .. class :: FeedParser(_factory=email.message.Message, *, policy=policy.compat32 )
6464
6565 Create a :class: `FeedParser ` instance. Optional *_factory * is a no-argument
6666 callable that will be called whenever a new message object is needed. It
6767 defaults to the :class: `email.message.Message ` class.
6868
69- The *policy * keyword specifies a :mod: `~email.policy ` object that controls a
70- number of aspects of the parser's operation. The default policy maintains
71- backward compatibility.
69+ If *policy * is specified (it must be an instance of a :mod: `~email.policy `
70+ class) use the rules it specifies to udpate the representation of the
71+ message. If *policy * is not set, use the :class: `compat32
72+ <email.policy.Compat32> ` policy, which maintains backward compatibility with
73+ the Python 3.2 version of the email package. For more information see the
74+ :mod: `~email.policy ` documentation.
7275
7376 .. versionchanged :: 3.3 Added the *policy* keyword.
7477
@@ -113,17 +116,20 @@ have the same API as the :class:`Parser` and :class:`BytesParser` classes.
113116 The BytesHeaderParser class.
114117
115118
116- .. class :: Parser(_class=email.message.Message, *, policy=policy.default )
119+ .. class :: Parser(_class=email.message.Message, *, policy=policy.compat32 )
117120
118121 The constructor for the :class: `Parser ` class takes an optional argument
119122 *_class *. This must be a callable factory (such as a function or a class), and
120123 it is used whenever a sub-message object needs to be created. It defaults to
121124 :class: `~email.message.Message ` (see :mod: `email.message `). The factory will
122125 be called without arguments.
123126
124- The *policy * keyword specifies a :mod: `~email.policy ` object that controls a
125- number of aspects of the parser's operation. The default policy maintains
126- backward compatibility.
127+ If *policy * is specified (it must be an instance of a :mod: `~email.policy `
128+ class) use the rules it specifies to udpate the representation of the
129+ message. If *policy * is not set, use the :class: `compat32
130+ <email.policy.Compat32> ` policy, which maintains backward compatibility with
131+ the Python 3.2 version of the email package. For more information see the
132+ :mod: `~email.policy ` documentation.
127133
128134 .. versionchanged :: 3.3
129135 Removed the *strict * argument that was deprecated in 2.4. Added the
@@ -159,15 +165,18 @@ have the same API as the :class:`Parser` and :class:`BytesParser` classes.
159165 Optional *headersonly * is as with the :meth: `parse ` method.
160166
161167
162- .. class :: BytesParser(_class=email.message.Message, *, policy=policy.default )
168+ .. class :: BytesParser(_class=email.message.Message, *, policy=policy.compat32 )
163169
164170 This class is exactly parallel to :class: `Parser `, but handles bytes input.
165171 The *_class * and *strict * arguments are interpreted in the same way as for
166172 the :class: `Parser ` constructor.
167173
168- The *policy * keyword specifies a :mod: `~email.policy ` object that
169- controls a number of aspects of the parser's operation. The default
170- policy maintains backward compatibility.
174+ If *policy * is specified (it must be an instance of a :mod: `~email.policy `
175+ class) use the rules it specifies to udpate the representation of the
176+ message. If *policy * is not set, use the :class: `compat32
177+ <email.policy.Compat32> ` policy, which maintains backward compatibility with
178+ the Python 3.2 version of the email package. For more information see the
179+ :mod: `~email.policy ` documentation.
171180
172181 .. versionchanged :: 3.3
173182 Removed the *strict * argument. Added the *policy * keyword.
@@ -209,7 +218,7 @@ in the top-level :mod:`email` package namespace.
209218.. currentmodule :: email
210219
211220.. function :: message_from_string(s, _class=email.message.Message, *, \
212- policy=policy.default )
221+ policy=policy.compat32 )
213222
214223 Return a message object structure from a string. This is exactly equivalent to
215224 ``Parser().parsestr(s) ``. *_class * and *policy * are interpreted as
@@ -219,7 +228,7 @@ in the top-level :mod:`email` package namespace.
219228 Removed the *strict * argument. Added the *policy * keyword.
220229
221230.. function :: message_from_bytes(s, _class=email.message.Message, *, \
222- policy=policy.default )
231+ policy=policy.compat32 )
223232
224233 Return a message object structure from a byte string. This is exactly
225234 equivalent to ``BytesParser().parsebytes(s) ``. Optional *_class * and
@@ -231,7 +240,7 @@ in the top-level :mod:`email` package namespace.
231240 Removed the *strict * argument. Added the *policy * keyword.
232241
233242.. function :: message_from_file(fp, _class=email.message.Message, *, \
234- policy=policy.default )
243+ policy=policy.compat32 )
235244
236245 Return a message object structure tree from an open :term: `file object `.
237246 This is exactly equivalent to ``Parser().parse(fp) ``. *_class *
@@ -242,7 +251,7 @@ in the top-level :mod:`email` package namespace.
242251 Removed the *strict * argument. Added the *policy * keyword.
243252
244253.. function :: message_from_binary_file(fp, _class=email.message.Message, *, \
245- policy=policy.default )
254+ policy=policy.compat32 )
246255
247256 Return a message object structure tree from an open binary :term: `file
248257 object `. This is exactly equivalent to ``BytesParser().parse(fp) ``.
0 commit comments