Skip to content

Commit 78deb7f

Browse files
srittaubenjaminp
authored andcommitted
closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965)
1 parent 9797b7a commit 78deb7f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/smtplib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ An :class:`SMTP` instance has the following methods:
346346

347347
If optional keyword argument *initial_response_ok* is true,
348348
``authobject()`` will be called first with no argument. It can return the
349-
:rfc:`4954` "initial response" bytes which will be encoded and sent with
349+
:rfc:`4954` "initial response" ASCII ``str`` which will be encoded and sent with
350350
the ``AUTH`` command as below. If the ``authobject()`` does not support an
351351
initial response (e.g. because it requires a challenge), it should return
352352
``None`` when called with ``challenge=None``. If *initial_response_ok* is
@@ -355,7 +355,7 @@ An :class:`SMTP` instance has the following methods:
355355
If the initial response check returns ``None``, or if *initial_response_ok* is
356356
false, ``authobject()`` will be called to process the server's challenge
357357
response; the *challenge* argument it is passed will be a ``bytes``. It
358-
should return ``bytes`` *data* that will be base64 encoded and sent to the
358+
should return ASCII ``str`` *data* that will be base64 encoded and sent to the
359359
server.
360360

361361
The ``SMTP`` class provides ``authobjects`` for the ``CRAM-MD5``, ``PLAIN``,

Lib/smtplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True):
615615
616616
It will be called to process the server's challenge response; the
617617
challenge argument it is passed will be a bytes. It should return
618-
bytes data that will be base64 encoded and sent to the server.
618+
an ASCII string that will be base64 encoded and sent to the server.
619619
620620
Keyword arguments:
621621
- initial_response_ok: Allow sending the RFC 4954 initial-response

0 commit comments

Comments
 (0)