Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/smtplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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``,
Expand Down
2 changes: 1 addition & 1 deletion Lib/smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down