summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-01-31 18:51:49 (GMT)
committerGeorg Brandl <georg@python.org>2010-01-31 18:51:49 (GMT)
commit979d79cd312d70faa5341cf5b4ada407590306f3 (patch)
tree5c44b709e8cd1690b5f8b53e153057af5272d023 /Doc
parent3fd2db9074b7380b5fdf570736dbe11240addbd0 (diff)
downloadcpython-979d79cd312d70faa5341cf5b4ada407590306f3.zip
cpython-979d79cd312d70faa5341cf5b4ada407590306f3.tar.gz
cpython-979d79cd312d70faa5341cf5b4ada407590306f3.tar.bz2
Fix-up ftplib documentation:
move exception descriptions to toplevel, not inside a class remove attribution in "versionadded" spell and grammar check docstring of FTP_TLS
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/ftplib.rst59
1 files changed, 29 insertions, 30 deletions
diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst
index 32fd6e8..3765d9e 100644
--- a/Doc/library/ftplib.rst
+++ b/Doc/library/ftplib.rst
@@ -33,8 +33,8 @@ Here's a sample session using the :mod:`ftplib` module::
'226 Transfer complete.'
>>> ftp.quit()
-The module defines the following items:
+The module defines the following items:
.. class:: FTP([host[, user[, passwd[, acct[, timeout]]]]])
@@ -49,26 +49,26 @@ The module defines the following items:
.. versionchanged:: 2.6
*timeout* was added.
+
.. class:: FTP_TLS([host[, user[, passwd[, acct[, keyfile[, certfile[, timeout]]]]]]])
A :class:`FTP` subclass which adds TLS support to FTP as described in
:rfc:`4217`.
Connect as usual to port 21 implicitly securing the FTP control connection
- before authenticating. Securing the data connection requires user to
- explicitly ask for it by calling :exc:`prot_p()` method.
- *keyfile* and *certfile* are optional - they can contain a PEM formatted
- private key and certificate chain file for the SSL connection.
+ before authenticating. Securing the data connection requires the user to
+ explicitly ask for it by calling the :meth:`prot_p` method.
+ *keyfile* and *certfile* are optional -- they can contain a PEM formatted
+ private key and certificate chain file name for the SSL connection.
- .. versionadded:: 2.7 Contributed by Giampaolo Rodola'
+ .. versionadded:: 2.7
-
- Here's a sample session using :class:`FTP_TLS` class:
+ Here's a sample session using the :class:`FTP_TLS` class:
>>> from ftplib import FTP_TLS
>>> ftps = FTP_TLS('ftp.python.org')
- >>> ftps.login() # login anonimously previously securing control channel
- >>> ftps.prot_p() # switch to secure data connection
- >>> ftps.retrlines('LIST') # list directory content securely
+ >>> ftps.login() # login anonymously before securing control channel
+ >>> ftps.prot_p() # switch to secure data connection
+ >>> ftps.retrlines('LIST') # list directory content securely
total 9
drwxr-xr-x 8 root wheel 1024 Jan 3 1994 .
drwxr-xr-x 8 root wheel 1024 Jan 3 1994 ..
@@ -84,43 +84,42 @@ The module defines the following items:
>>>
+.. exception:: error_reply
- .. attribute:: all_errors
-
- The set of all exceptions (as a tuple) that methods of :class:`FTP`
- instances may raise as a result of problems with the FTP connection (as
- opposed to programming errors made by the caller). This set includes the
- four exceptions listed below as well as :exc:`socket.error` and
- :exc:`IOError`.
+ Exception raised when an unexpected reply is received from the server.
- .. exception:: error_reply
+.. exception:: error_temp
- Exception raised when an unexpected reply is received from the server.
+ Exception raised when an error code in the range 400--499 is received.
- .. exception:: error_temp
+.. exception:: error_perm
- Exception raised when an error code in the range 400--499 is received.
+ Exception raised when an error code in the range 500--599 is received.
- .. exception:: error_perm
+.. exception:: error_proto
- Exception raised when an error code in the range 500--599 is received.
+ Exception raised when a reply is received from the server that does not
+ begin with a digit in the range 1--5.
- .. exception:: error_proto
+.. data:: all_errors
- Exception raised when a reply is received from the server that does not
- begin with a digit in the range 1--5.
+ The set of all exceptions (as a tuple) that methods of :class:`FTP`
+ instances may raise as a result of problems with the FTP connection (as
+ opposed to programming errors made by the caller). This set includes the
+ four exceptions listed below as well as :exc:`socket.error` and
+ :exc:`IOError`.
.. seealso::
Module :mod:`netrc`
- Parser for the :file:`.netrc` file format. The file :file:`.netrc` is typically
- used by FTP clients to load user authentication information before prompting the
- user.
+ Parser for the :file:`.netrc` file format. The file :file:`.netrc` is
+ typically used by FTP clients to load user authentication information
+ before prompting the user.
.. index:: single: ftpmirror.py