[Python-checkins] gh-101021: Document binary parameters as bytes (GH-101024)

miss-islington webhook-mailer at python.org
Sat Jan 14 15:22:20 EST 2023


https://github.com/python/cpython/commit/39c1f68fff41766da673ccfd219e1f159f903103
commit: 39c1f68fff41766da673ccfd219e1f159f903103
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-01-14T12:22:08-08:00
summary:

gh-101021: Document binary parameters as bytes (GH-101024)

(cherry picked from commit 49cae39ef020eaf242607bb2d2d193760b9855a6)

Co-authored-by: Bob Kline <bkline at users.noreply.github.com>

files:
M Doc/library/email.mime.rst
M Lib/email/mime/application.py
M Lib/email/mime/audio.py
M Lib/email/mime/image.py

diff --git a/Doc/library/email.mime.rst b/Doc/library/email.mime.rst
index 3fe5fe88a094..d7c0d203d191 100644
--- a/Doc/library/email.mime.rst
+++ b/Doc/library/email.mime.rst
@@ -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 as au, wav, aiff, or aifc, 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 type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm,
    rast, xbm, bmp, webp, and exr attempted), then the subtype will be
    automatically included in the :mailheader:`Content-Type` header. Otherwise
diff --git a/Lib/email/mime/application.py b/Lib/email/mime/application.py
index 6877e554e102..f67cbad3f034 100644
--- a/Lib/email/mime/application.py
+++ b/Lib/email/mime/application.py
@@ -17,7 +17,7 @@ def __init__(self, _data, _subtype='octet-stream',
                  _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'.
diff --git a/Lib/email/mime/audio.py b/Lib/email/mime/audio.py
index 8815f5c5ec06..065819b2a210 100644
--- a/Lib/email/mime/audio.py
+++ b/Lib/email/mime/audio.py
@@ -18,7 +18,7 @@ def __init__(self, _audiodata, _subtype=None,
                  _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 as au, wav, aiff, or aifc, then the
         subtype will be automatically included in the Content-Type header.
         Otherwise, you can specify  the specific audio subtype via the
diff --git a/Lib/email/mime/image.py b/Lib/email/mime/image.py
index e19dea91c0c9..4b7f2f9cbad4 100644
--- a/Lib/email/mime/image.py
+++ b/Lib/email/mime/image.py
@@ -17,7 +17,7 @@ def __init__(self, _imagedata, _subtype=None,
                  _encoder=encoders.encode_base64, *, policy=None, **_params):
         """Create an image/* type MIME document.
 
-        _imagedata is a string containing the raw image data.  If the data
+        _imagedata contains the bytes for the raw image data.  If the data
         type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm,
         rast, xbm, bmp, webp, and exr attempted), then the subtype will be
         automatically included in the Content-Type header. Otherwise, you can



More information about the Python-checkins mailing list