@@ -371,7 +371,7 @@ added matters. To illustrate::
371371 to) :rfc: `5322 `, :rfc: `2047 `, and the current MIME RFCs.
372372
373373 This policy adds new header parsing and folding algorithms. Instead of
374- simple strings, headers are custom objects with custom attributes depending
374+ simple strings, headers are `` str `` subclasses with attributes that depend
375375 on the type of the field. The parsing and folding algorithm fully implement
376376 :rfc: `2047 ` and :rfc: `5322 `.
377377
@@ -408,6 +408,20 @@ added matters. To illustrate::
408408 fields are treated as unstructured. This list will be completed before
409409 the extension is marked stable.)
410410
411+ .. attribute :: content_manager
412+
413+ An object with at least two methods: get_content and set_content. When
414+ the :meth: `~email.message.Message.get_content ` or
415+ :meth: `~email.message.Message.set_content ` method of a
416+ :class: `~email.message.Message ` object is called, it calls the
417+ corresponding method of this object, passing it the message object as its
418+ first argument, and any arguments or keywords that were passed to it as
419+ additional arguments. By default ``content_manager `` is set to
420+ :data: `~email.contentmanager.raw_data_manager `.
421+
422+ .. versionadded 3.4
423+
424+
411425 The class provides the following concrete implementations of the abstract
412426 methods of :class: `Policy `:
413427
@@ -427,15 +441,15 @@ added matters. To illustrate::
427441 The name is returned unchanged. If the input value has a ``name ``
428442 attribute and it matches *name * ignoring case, the value is returned
429443 unchanged. Otherwise the *name * and *value * are passed to
430- ``header_factory ``, and the resulting custom header object is returned as
444+ ``header_factory ``, and the resulting header object is returned as
431445 the value. In this case a ``ValueError `` is raised if the input value
432446 contains CR or LF characters.
433447
434448 .. method :: header_fetch_parse(name, value)
435449
436450 If the value has a ``name `` attribute, it is returned to unmodified.
437451 Otherwise the *name *, and the *value * with any CR or LF characters
438- removed, are passed to the ``header_factory ``, and the resulting custom
452+ removed, are passed to the ``header_factory ``, and the resulting
439453 header object is returned. Any surrogateescaped bytes get turned into
440454 the unicode unknown-character glyph.
441455
@@ -445,9 +459,9 @@ added matters. To illustrate::
445459 A value is considered to be a 'source value' if and only if it does not
446460 have a ``name `` attribute (having a ``name `` attribute means it is a
447461 header object of some sort). If a source value needs to be refolded
448- according to the policy, it is converted into a custom header object by
462+ according to the policy, it is converted into a header object by
449463 passing the *name * and the *value * with any CR and LF characters removed
450- to the ``header_factory ``. Folding of a custom header object is done by
464+ to the ``header_factory ``. Folding of a header object is done by
451465 calling its ``fold `` method with the current policy.
452466
453467 Source values are split into lines using :meth: `~str.splitlines `. If
@@ -502,23 +516,23 @@ With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API of
502516the email package is changed from the Python 3.2 API in the following ways:
503517
504518 * Setting a header on a :class: `~email.message.Message ` results in that
505- header being parsed and a custom header object created.
519+ header being parsed and a header object created.
506520
507521 * Fetching a header value from a :class: `~email.message.Message ` results
508- in that header being parsed and a custom header object created and
522+ in that header being parsed and a header object created and
509523 returned.
510524
511- * Any custom header object, or any header that is refolded due to the
525+ * Any header object, or any header that is refolded due to the
512526 policy settings, is folded using an algorithm that fully implements the
513527 RFC folding algorithms, including knowing where encoded words are required
514528 and allowed.
515529
516530From the application view, this means that any header obtained through the
517- :class: `~email.message.Message ` is a custom header object with custom
531+ :class: `~email.message.Message ` is a header object with extra
518532attributes, whose string value is the fully decoded unicode value of the
519533header. Likewise, a header may be assigned a new value, or a new header
520534created, using a unicode string, and the policy will take care of converting
521535the unicode string into the correct RFC encoded form.
522536
523- The custom header objects and their attributes are described in
537+ The header objects and their attributes are described in
524538:mod: `~email.headerregistry `.
0 commit comments