Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 021362d

Browse files
committed
#18179: reflow paragraphs.
1 parent 36beb66 commit 021362d

2 files changed

Lines changed: 47 additions & 46 deletions

File tree

Doc/library/smtplib.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
2424

2525
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
2626
that support a full repertoire of SMTP and ESMTP operations. If the optional
27-
host and port parameters are given, the SMTP :meth:`connect` method is called
28-
with those parameters during initialization. If specified, *local_hostname* is
29-
used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the
30-
local hostname is found using :func:`socket.getfqdn`. If the
31-
:meth:`connect` call
32-
returns anything other than a success code, an :exc:`SMTPConnectError` is
33-
raised. The optional *timeout* parameter specifies a timeout in seconds for
34-
blocking operations like the connection attempt (if not specified, the
35-
global default timeout setting will be used). The optional source_address
36-
parameter allows to bind to some specific source address in a machine with
37-
multiple network interfaces, and/or to some specific source TCP port. It
38-
takes a 2-tuple (host, port), for the socket to bind to as its source
39-
address before connecting. If omitted (or if host or port are ``''`` and/or
40-
0 respectively) the OS default behavior will be used.
27+
host and port parameters are given, the SMTP :meth:`connect` method is
28+
called with those parameters during initialization. If specified,
29+
*local_hostname* is used as the FQDN of the local host in the HELO/EHLO
30+
command. Otherwise, the local hostname is found using
31+
:func:`socket.getfqdn`. If the :meth:`connect` call returns anything other
32+
than a success code, an :exc:`SMTPConnectError` is raised. The optional
33+
*timeout* parameter specifies a timeout in seconds for blocking operations
34+
like the connection attempt (if not specified, the global default timeout
35+
setting will be used). The optional source_address parameter allows to bind
36+
to some specific source address in a machine with multiple network
37+
interfaces, and/or to some specific source TCP port. It takes a 2-tuple
38+
(host, port), for the socket to bind to as its source address before
39+
connecting. If omitted (or if host or port are ``''`` and/or 0 respectively)
40+
the OS default behavior will be used.
4141

4242
For normal use, you should only require the initialization/connect,
4343
:meth:`sendmail`, and :meth:`~smtplib.quit` methods.
@@ -70,11 +70,11 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
7070
not appropriate. If *host* is not specified, the local host is used. If
7171
*port* is zero, the standard SMTP-over-SSL port (465) is used. The optional
7272
arguments *local_hostname* and *source_address* have the same meaning as
73-
they do in the :class:`SMTP` class. *keyfile*
74-
and *certfile* are also optional, and can contain a PEM formatted private key
75-
and certificate chain file for the SSL connection. *context* also optional, can contain
76-
a SSLContext, and is an alternative to keyfile and certfile; If it is specified both
77-
keyfile and certfile must be None. The optional *timeout*
73+
they do in the :class:`SMTP` class. *keyfile* and *certfile* are also
74+
optional, and can contain a PEM formatted private key and certificate chain
75+
file for the SSL connection. *context* also optional, can contain a
76+
SSLContext, and is an alternative to keyfile and certfile; If it is
77+
specified both keyfile and certfile must be None. The optional *timeout*
7878
parameter specifies a timeout in seconds for blocking operations like the
7979
connection attempt (if not specified, the global default timeout setting
8080
will be used). The optional source_address parameter allows to bind to some
@@ -97,12 +97,12 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
9797
standard SMTP client. It's common to use Unix sockets for LMTP, so our
9898
:meth:`connect` method must support that as well as a regular host:port
9999
server. The optional arguments local_hostname and source_address have the
100-
same meaning as they do in the :class:`SMTP` class. To specify a Unix socket, you must use
101-
an absolute path for *host*, starting with a '/'.
100+
same meaning as they do in the :class:`SMTP` class. To specify a Unix
101+
socket, you must use an absolute path for *host*, starting with a '/'.
102102

103-
Authentication is supported, using the regular SMTP mechanism. When using a Unix
104-
socket, LMTP generally don't support or require any authentication, but your
105-
mileage might vary.
103+
Authentication is supported, using the regular SMTP mechanism. When using a
104+
Unix socket, LMTP generally don't support or require any authentication, but
105+
your mileage might vary.
106106

107107

108108
A nice selection of exceptions is defined as well:

Lib/smtplib.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ def __init__(self, host='', port=0, local_hostname=None,
222222
If specified, `host' is the name of the remote host to which to
223223
connect. If specified, `port' specifies the port to which to connect.
224224
By default, smtplib.SMTP_PORT is used. If a host is specified the
225-
connect method is called, and if it returns anything other than
226-
a success code an SMTPConnectError is raised. If specified,
227-
`local_hostname` is used as the FQDN of the local host in the
228-
HELO/EHLO command. Otherwise,
229-
the local hostname is found using socket.getfqdn(). The
230-
`source_address` parameter takes a 2-tuple (host, port) for the socket
231-
to bind to as its source address before connecting. If the host is ''
232-
and port is 0, the OS default behavior will be used.
225+
connect method is called, and if it returns anything other than a
226+
success code an SMTPConnectError is raised. If specified,
227+
`local_hostname` is used as the FQDN of the local host in the HELO/EHLO
228+
command. Otherwise, the local hostname is found using
229+
socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
230+
port) for the socket to bind to as its source address before
231+
connecting. If the host is '' and port is 0, the OS default behavior
232+
will be used.
233233
234234
"""
235235
self.timeout = timeout
@@ -853,15 +853,17 @@ def quit(self):
853853
if _have_ssl:
854854

855855
class SMTP_SSL(SMTP):
856-
""" This is a subclass derived from SMTP that connects over an SSL encrypted
857-
socket (to use this class you need a socket module that was compiled with SSL
858-
support). If host is not specified, '' (the local host) is used. If port is
859-
omitted, the standard SMTP-over-SSL port (465) is used. local_hostname and
860-
source_address have the same meaning as they do in the SMTP class. keyfile and certfile
861-
are also optional - they can contain a PEM formatted private key and
862-
certificate chain file for the SSL connection. context also optional, can contain
863-
a SSLContext, and is an alternative to keyfile and certfile; If it is specified both
864-
keyfile and certfile must be None.
856+
""" This is a subclass derived from SMTP that connects over an SSL
857+
encrypted socket (to use this class you need a socket module that was
858+
compiled with SSL support). If host is not specified, '' (the local
859+
host) is used. If port is omitted, the standard SMTP-over-SSL port
860+
(465) is used. local_hostname and source_address have the same meaning
861+
as they do in the SMTP class. keyfile and certfile are also optional -
862+
they can contain a PEM formatted private key and certificate chain file
863+
for the SSL connection. context also optional, can contain a
864+
SSLContext, and is an alternative to keyfile and certfile; If it is
865+
specified both keyfile and certfile must be None.
866+
865867
"""
866868

867869
default_port = SMTP_SSL_PORT
@@ -904,12 +906,11 @@ class LMTP(SMTP):
904906
"""LMTP - Local Mail Transfer Protocol
905907
906908
The LMTP protocol, which is very similar to ESMTP, is heavily based
907-
on the standard SMTP client. It's common to use Unix sockets for LMTP,
908-
so our connect() method must support that as well as a regular
909+
on the standard SMTP client. It's common to use Unix sockets for
910+
LMTP, so our connect() method must support that as well as a regular
909911
host:port server. local_hostname and source_address have the same
910-
meaning as they do in the SMTP class.
911-
To specify a Unix socket, you must use an absolute
912-
path as the host, starting with a '/'.
912+
meaning as they do in the SMTP class. To specify a Unix socket,
913+
you must use an absolute path as the host, starting with a '/'.
913914
914915
Authentication is supported, using the regular SMTP mechanism. When
915916
using a Unix socket, LMTP generally don't support or require any

0 commit comments

Comments
 (0)