[Python-checkins] closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965)

Miss Islington (bot) webhook-mailer at python.org
Mon Sep 10 14:16:15 EDT 2018


https://github.com/python/cpython/commit/c0db8177dc9a7f79941551576e1faea9724e027d
commit: c0db8177dc9a7f79941551576e1faea9724e027d
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-09-10T11:16:11-07:00
summary:

closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965)

(cherry picked from commit 78deb7f33227972987722bc3fed5bcb45fae869e)

Co-authored-by: Sebastian Rittau <srittau at rittau.org>

files:
M Doc/library/smtplib.rst
M Lib/smtplib.py

diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 805217252ae8..6fb0934218a6 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -346,7 +346,7 @@ An :class:`SMTP` instance has the following methods:
 
    If optional keyword argument *initial_response_ok* is true,
    ``authobject()`` will be called first with no argument.  It can return the
-   :rfc:`4954` "initial response" bytes which will be encoded and sent with
+   :rfc:`4954` "initial response" ASCII ``str`` which will be encoded and sent with
    the ``AUTH`` command as below.  If the ``authobject()`` does not support an
    initial response (e.g. because it requires a challenge), it should return
    ``None`` when called with ``challenge=None``.  If *initial_response_ok* is
@@ -355,7 +355,7 @@ An :class:`SMTP` instance has the following methods:
    If the initial response check returns ``None``, or if *initial_response_ok* is
    false, ``authobject()`` will be called to process the server's challenge
    response; the *challenge* argument it is passed will be a ``bytes``.  It
-   should return ``bytes`` *data* that will be base64 encoded and sent to the
+   should return ASCII ``str`` *data* that will be base64 encoded and sent to the
    server.
 
    The ``SMTP`` class provides ``authobjects`` for the ``CRAM-MD5``, ``PLAIN``,
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 048c6bfb0671..5e1bc0b198ed 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -615,7 +615,7 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True):
 
         It will be called to process the server's challenge response; the
         challenge argument it is passed will be a bytes.  It should return
-        bytes data that will be base64 encoded and sent to the server.
+        an ASCII string that will be base64 encoded and sent to the server.
 
         Keyword arguments:
             - initial_response_ok: Allow sending the RFC 4954 initial-response



More information about the Python-checkins mailing list