diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-08-13 03:51:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 03:51:02 (GMT) |
commit | 4ee06b3eef55b00c125f21219d970ac07fb9b996 (patch) | |
tree | 1826f2e7b0fdfdb3593c9fb195d7dd00838b6022 | |
parent | 4cd33cdda67451c9125a2a350ad533aa54762316 (diff) | |
download | cpython-4ee06b3eef55b00c125f21219d970ac07fb9b996.zip cpython-4ee06b3eef55b00c125f21219d970ac07fb9b996.tar.gz cpython-4ee06b3eef55b00c125f21219d970ac07fb9b996.tar.bz2 |
smtplib documentation fixes (GH-8708)
* SMTP.startssl: Fix doc on keyfile and certfile use
* SMTP.startssl: Add missing keyfile and certfile deprecation notice
* SMTP: Doc grammar fixes
(cherry picked from commit da12063f2f53b7d272824863ed24260cefb22e8c)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
-rw-r--r-- | Doc/library/smtplib.rst | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 86e769e..e5effd0 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -271,7 +271,7 @@ An :class:`SMTP` instance has the following methods: .. method:: SMTP.ehlo_or_helo_if_needed() - This method call :meth:`ehlo` and or :meth:`helo` if there has been no + This method calls :meth:`ehlo` and/or :meth:`helo` if there has been no previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first. @@ -379,16 +379,23 @@ An :class:`SMTP` instance has the following methods: commands that follow will be encrypted. You should then call :meth:`ehlo` again. - If *keyfile* and *certfile* are provided, these are passed to the :mod:`socket` - module's :func:`ssl` function. + If *keyfile* and *certfile* are provided, they are used to create an + :class:`ssl.SSLContext`. - Optional *context* parameter is a :class:`ssl.SSLContext` object; This is + Optional *context* parameter is an :class:`ssl.SSLContext` object; This is an alternative to using a keyfile and a certfile and if specified both *keyfile* and *certfile* should be ``None``. If there has been no previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP ``EHLO`` first. + .. deprecated:: 3.6 + + *keyfile* and *certfile* are deprecated in favor of *context*. + Please use :meth:`ssl.SSLContext.load_cert_chain` instead, or let + :func:`ssl.create_default_context` select the system's trusted CA + certificates for you. + :exc:`SMTPHeloError` The server didn't reply properly to the ``HELO`` greeting. |