Issue #25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
to fix the grammar.
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
index 675ed97..7da2d43 100644
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -90,7 +90,7 @@
The key-function patterns shown above are very common, so Python provides
convenience functions to make accessor functions easier and faster. The operator
module has :func:`operator.itemgetter`, :func:`operator.attrgetter`, and
-starting in Python 2.5 a :func:`operator.methodcaller` function.
+starting in Python 2.5 an :func:`operator.methodcaller` function.
Using those functions, the above examples become simpler and faster:
diff --git a/Doc/library/chunk.rst b/Doc/library/chunk.rst
index 04c7e27..d31fa0a 100644
--- a/Doc/library/chunk.rst
+++ b/Doc/library/chunk.rst
@@ -48,7 +48,7 @@
the :class:`Chunk` class defined here is to instantiate an instance at the start
of each chunk and read from the instance until it reaches the end, after which a
new instance can be instantiated. At the end of the file, creating a new
-instance will fail with a :exc:`EOFError` exception.
+instance will fail with an :exc:`EOFError` exception.
.. class:: Chunk(file[, align, bigendian, inclheader])
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index ead6b7a..c6bf3ef 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -276,7 +276,7 @@
generating the delta lines) in unified diff format.
Unified diffs are a compact way of showing just the lines that have changed plus
- a few lines of context. The changes are shown in a inline style (instead of
+ a few lines of context. The changes are shown in an inline style (instead of
separate before/after blocks). The number of context lines is set by *n* which
defaults to three.
diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst
index 3ab7b3b..b155daf 100644
--- a/Doc/library/ftplib.rst
+++ b/Doc/library/ftplib.rst
@@ -283,9 +283,9 @@
.. method:: FTP.transfercmd(cmd[, rest])
- Initiate a transfer over the data connection. If the transfer is active, send a
+ Initiate a transfer over the data connection. If the transfer is active, send an
``EPRT`` or ``PORT`` command and the transfer command specified by *cmd*, and
- accept the connection. If the server is passive, send a ``EPSV`` or ``PASV``
+ accept the connection. If the server is passive, send an ``EPSV`` or ``PASV``
command, connect to it, and start the transfer command. Either way, return the
socket for the connection.
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index d3cdbf1..633a6af 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -221,7 +221,7 @@
Even though :class:`IOBase` does not declare :meth:`read`, :meth:`readinto`,
or :meth:`write` because their signatures will vary, implementations and
clients should consider those methods part of the interface. Also,
- implementations may raise a :exc:`IOError` when operations they do not
+ implementations may raise an :exc:`IOError` when operations they do not
support are called.
The basic type used for binary data read from or written to a file is
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index dfb43a1..c1ed15b 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -1327,7 +1327,7 @@
the list of arguments to process (default: ``sys.argv[1:]``)
``values``
- a :class:`optparse.Values` object to store option arguments in (default: a
+ an :class:`optparse.Values` object to store option arguments in (default: a
new instance of :class:`Values`) -- if you give an existing object, the
option defaults will not be initialized on it
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 5d7edd1..99a36af 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -256,7 +256,7 @@
.. function:: samefile(path1, path2)
Return ``True`` if both pathname arguments refer to the same file or directory
- (as indicated by device number and i-node number). Raise an exception if a
+ (as indicated by device number and i-node number). Raise an exception if an
:func:`os.stat` call on either pathname fails.
Availability: Unix.
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 5b2808d..b6e7689 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -22,7 +22,7 @@
.. class:: SMTP([host[, port[, local_hostname[, timeout]]]])
- A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
+ An :class:`SMTP` instance encapsulates an SMTP connection. It has methods
that support a full repertoire of SMTP and ESMTP operations. If the optional
host and port parameters are given, the SMTP :meth:`connect` method is
called with those parameters during initialization. If specified,
@@ -45,7 +45,7 @@
.. class:: SMTP_SSL([host[, port[, local_hostname[, keyfile[, certfile[, timeout]]]]]])
- A :class:`SMTP_SSL` instance behaves exactly the same as instances of
+ An :class:`SMTP_SSL` instance behaves exactly the same as instances of
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is
required from the beginning of the connection and using :meth:`starttls` is
not appropriate. If *host* is not specified, the local host is used. If
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index f79eba6..73b5d5c 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -757,7 +757,7 @@
Set blocking or non-blocking mode of the socket: if *flag* is 0, the socket is
set to non-blocking, else to blocking mode. Initially all sockets are in
blocking mode. In non-blocking mode, if a :meth:`recv` call doesn't find any
- data, or if a :meth:`send` call can't immediately dispose of the data, a
+ data, or if a :meth:`send` call can't immediately dispose of the data, an
:exc:`error` exception is raised; in blocking mode, the calls block until they
can proceed. ``s.setblocking(0)`` is equivalent to ``s.settimeout(0.0)``;
``s.setblocking(1)`` is equivalent to ``s.settimeout(None)``.
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index f897234..2b730e8 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -583,7 +583,7 @@
.. attribute:: lastrowid
This read-only attribute provides the rowid of the last modified row. It is
- only set if you issued a ``INSERT`` statement using the :meth:`execute`
+ only set if you issued an ``INSERT`` statement using the :meth:`execute`
method. For operations other than ``INSERT`` or when :meth:`executemany` is
called, :attr:`lastrowid` is set to :const:`None`.
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
index 4bdb99b..5d57d4b 100644
--- a/Doc/library/sunau.rst
+++ b/Doc/library/sunau.rst
@@ -54,8 +54,8 @@
Note that it does not allow read/write files.
- A *mode* of ``'r'`` returns a :class:`AU_read` object, while a *mode* of ``'w'``
- or ``'wb'`` returns a :class:`AU_write` object.
+ A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of ``'w'``
+ or ``'wb'`` returns an :class:`AU_write` object.
.. function:: openfp(file, mode)
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index f74b89f..03c5713 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -20,7 +20,7 @@
the user exits the browser.
If the environment variable :envvar:`BROWSER` exists, it is interpreted to
-override the platform default list of browsers, as a :data:`os.pathsep`-separated
+override the platform default list of browsers, as an :data:`os.pathsep`-separated
list of browsers to try in order. When the value of a list part contains the
string ``%s``, then it is interpreted as a literal browser command line to be
used with the argument URL substituted for ``%s``; if the part does not contain
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 9e62dfc..3f3b30f 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1418,7 +1418,7 @@
will not be usable in hashed collections. If a class defines mutable objects
and implements a :meth:`__cmp__` or :meth:`__eq__` method, it should not
implement :meth:`__hash__`, since hashable collection implementations require
- that a object's hash value is immutable (if the object's hash value changes,
+ that an object's hash value is immutable (if the object's hash value changes,
it will be in the wrong hash bucket).
User-defined classes have :meth:`__cmp__` and :meth:`__hash__` methods
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index f93a544..9787e6b 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -345,7 +345,7 @@
A *finally clause* is always executed before leaving the :keyword:`try`
statement, whether an exception has occurred or not. When an exception has
occurred in the :keyword:`try` clause and has not been handled by an
-:keyword:`except` clause (or it has occurred in a :keyword:`except` or
+:keyword:`except` clause (or it has occurred in an :keyword:`except` or
:keyword:`else` clause), it is re-raised after the :keyword:`finally` clause has
been executed. The :keyword:`finally` clause is also executed "on the way out"
when any other clause of the :keyword:`try` statement is left via a
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
index d25e48d..f756506 100644
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -555,7 +555,7 @@
and experiment with them. With the result experience, perhaps it'll be possible
to design a really good catalog and then build support for it into Python 2.2.
For example, the Distutils :command:`sdist` and :command:`bdist_\*` commands
-could support a ``upload`` option that would automatically upload your
+could support an ``upload`` option that would automatically upload your
package to a catalog server.
You can start creating packages containing :file:`PKG-INFO` even if you're not