Commit 226c14de authored by R David Murray's avatar R David Murray

#27893: arg name and bytes references in email.parser docs.

Perhaps the BytesParser 'text' argument should really be bytes, but
it hasn't been, it has been text, so for backward compatibility
and for consistency with the regular Parser class, I'm keeping it
as 'text'.
parent 720faafa
...@@ -202,12 +202,12 @@ have the same API as the :class:`Parser` and :class:`BytesParser` classes. ...@@ -202,12 +202,12 @@ have the same API as the :class:`Parser` and :class:`BytesParser` classes.
reading the headers or not. The default is ``False``, meaning it parses reading the headers or not. The default is ``False``, meaning it parses
the entire contents of the file. the entire contents of the file.
.. method:: parsebytes(bytes, headersonly=False) .. method:: parsebytes(text, headersonly=False)
Similar to the :meth:`parse` method, except it takes a byte string object Similar to the :meth:`parse` method, except it takes a :term:`bytes-like
instead of a file-like object. Calling this method on a byte string is object` instead of a file-like object. Calling this method is equivalent
exactly equivalent to wrapping *text* in a :class:`~io.BytesIO` instance to wrapping *text* in a :class:`~io.BytesIO` instance first and calling
first and calling :meth:`parse`. :meth:`parse`.
Optional *headersonly* is as with the :meth:`parse` method. Optional *headersonly* is as with the :meth:`parse` method.
...@@ -233,7 +233,7 @@ in the top-level :mod:`email` package namespace. ...@@ -233,7 +233,7 @@ in the top-level :mod:`email` package namespace.
.. function:: message_from_bytes(s, _class=email.message.Message, *, \ .. function:: message_from_bytes(s, _class=email.message.Message, *, \
policy=policy.compat32) policy=policy.compat32)
Return a message object structure from a byte string. This is exactly Return a message object structure from a :term:`bytes-like object`. This is exactly
equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and
*strict* are interpreted as with the :class:`~email.parser.Parser` class *strict* are interpreted as with the :class:`~email.parser.Parser` class
constructor. constructor.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment