]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-101021: Document binary parameters as bytes (GH-101024). (#101052)
authorBarry Warsaw <barry@python.org>
Sun, 15 Jan 2023 05:31:59 +0000 (21:31 -0800)
committerGitHub <noreply@github.com>
Sun, 15 Jan 2023 05:31:59 +0000 (21:31 -0800)
(cherry picked from commit 49cae39ef020eaf242607bb2d2d193760b9855a6)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
Doc/library/email.mime.rst
Lib/email/mime/application.py
Lib/email/mime/audio.py
Lib/email/mime/image.py

index f37f6aa28dec7d9fe0bd4c2b5e082326e82f38fa..98e1258eb352a7387ec69a398db5cceefd449aa0 100644 (file)
@@ -114,9 +114,9 @@ Here are the classes:
 
    A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the
    :class:`MIMEApplication` class is used to represent MIME message objects of
-   major type :mimetype:`application`.  *_data* is a string containing the raw
-   byte data.  Optional *_subtype* specifies the MIME subtype and defaults to
-   :mimetype:`octet-stream`.
+   major type :mimetype:`application`.  *_data* contains the bytes for the raw
+   application data.  Optional *_subtype* specifies the MIME subtype and defaults
+   to :mimetype:`octet-stream`.
 
    Optional *_encoder* is a callable (i.e. function) which will perform the actual
    encoding of the data for transport.  This callable takes one argument, which is
@@ -145,7 +145,7 @@ Here are the classes:
 
    A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the
    :class:`MIMEAudio` class is used to create MIME message objects of major type
-   :mimetype:`audio`. *_audiodata* is a string containing the raw audio data.  If
+   :mimetype:`audio`. *_audiodata* contains the bytes for the raw audio data.  If
    this data can be decoded by the standard Python module :mod:`sndhdr`, then the
    subtype will be automatically included in the :mailheader:`Content-Type` header.
    Otherwise you can explicitly specify the audio subtype via the *_subtype*
@@ -179,7 +179,7 @@ Here are the classes:
 
    A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the
    :class:`MIMEImage` class is used to create MIME message objects of major type
-   :mimetype:`image`. *_imagedata* is a string containing the raw image data.  If
+   :mimetype:`image`. *_imagedata* contains the bytes for the raw image data.  If
    this data can be decoded by the standard Python module :mod:`imghdr`, then the
    subtype will be automatically included in the :mailheader:`Content-Type` header.
    Otherwise you can explicitly specify the image subtype via the *_subtype*
index 6877e554e1027171e34cb2336daa0b7677258a26..f67cbad3f03407618de8f7ae1b2a86fc913e62f8 100644 (file)
@@ -17,7 +17,7 @@ class MIMEApplication(MIMENonMultipart):
                  _encoder=encoders.encode_base64, *, policy=None, **_params):
         """Create an application/* type MIME document.
 
-        _data is a string containing the raw application data.
+        _data contains the bytes for the raw application data.
 
         _subtype is the MIME content type subtype, defaulting to
         'octet-stream'.
index 4bcd7b224a862a7e977cb31f1079cf038bbbee75..7cca3f99f12861630fd0765ee5ae48a0f0f4bf8c 100644 (file)
@@ -46,7 +46,7 @@ class MIMEAudio(MIMENonMultipart):
                  _encoder=encoders.encode_base64, *, policy=None, **_params):
         """Create an audio/* type MIME document.
 
-        _audiodata is a string containing the raw audio data.  If this data
+        _audiodata contains the bytes for the raw audio data.  If this data
         can be decoded by the standard Python `sndhdr' module, then the
         subtype will be automatically included in the Content-Type header.
         Otherwise, you can specify  the specific audio subtype via the
index 92724643cdeeac4dba730d7b6b93226db5710bda..6dc7ec4ca2016d2d6789fbe45a6ceb5e48de689c 100644 (file)
@@ -20,7 +20,7 @@ class MIMEImage(MIMENonMultipart):
                  _encoder=encoders.encode_base64, *, policy=None, **_params):
         """Create an image/* type MIME document.
 
-        _imagedata is a string containing the raw image data.  If this data
+        _imagedata contains the bytes for the raw image data.  If the data
         can be decoded by the standard Python `imghdr' module, then the
         subtype will be automatically included in the Content-Type header.
         Otherwise, you can specify the specific image subtype via the _subtype