From: Martin Panter Date: Fri, 15 Apr 2016 02:14:19 +0000 (+0000) Subject: Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc X-Git-Tag: v2.7.12rc1~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a8163a928f9ff04242580c09216431ddd39cdbc;p=thirdparty%2FPython%2Fcpython.git Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc This affects documentation and code comments. --- diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 13a28075bb70..3262354d0121 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -234,7 +234,7 @@ APIs: .. c:function:: PyObject *PyUnicode_FromString(const char *u) - Create a Unicode object from an UTF-8 encoded null-terminated char buffer + Create a Unicode object from a UTF-8 encoded null-terminated char buffer *u*. .. versionadded:: 2.6 @@ -347,7 +347,7 @@ APIs: .. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, const char *encoding, const char *errors) - Coerce an encoded object *obj* to an Unicode object and return a reference with + Coerce an encoded object *obj* to a Unicode object and return a reference with incremented refcount. String and other char buffer compatible objects are decoded according to the @@ -663,7 +663,7 @@ These are the UTF-16 codec APIs: If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE` - values is interpreted as an UCS-2 character. + values is interpreted as a UCS-2 character. Return *NULL* if an exception was raised by the codec. diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst index 30763a26a52d..42e84d3fb64c 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -55,7 +55,7 @@ The simplest way to use urllib2 is as follows:: html = response.read() Many uses of urllib2 will be that simple (note that instead of an 'http:' URL we -could have used an URL starting with 'ftp:', 'file:', etc.). However, it's the +could have used a URL starting with 'ftp:', 'file:', etc.). However, it's the purpose of this tutorial to explain the more complicated cases, concentrating on HTTP. diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 3687f867664d..e58d95427db5 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1873,7 +1873,7 @@ Utility functions allows specifying the size of the array if the length of the string should not be used. - If the first parameter is a 8-bit string, it is converted into an unicode string + If the first parameter is a 8-bit string, it is converted into a unicode string according to ctypes conversion rules. diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 16b2fd508ba7..3dce0376b75a 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -244,7 +244,7 @@ for a tournament. The numbers below are *k*, not ``a[k]``:: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In an usual +In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a usual binary tournament we see in sports, each cell is the winner over the two cells it tops, and we can trace the winner down the tree to see all opponents s/he had. However, in many computer applications of such tournaments, we do not need diff --git a/Doc/library/ic.rst b/Doc/library/ic.rst index ab40e7a941a1..5067084ddbcf 100644 --- a/Doc/library/ic.rst +++ b/Doc/library/ic.rst @@ -83,7 +83,7 @@ methods: .. method:: IC.parseurl(data[, start[, end[, hint]]]) - Find an URL somewhere in *data* and return start position, end position and the + Find a URL somewhere in *data* and return start position, end position and the URL. The optional *start* and *end* can be used to limit the search, so for instance if a user clicks in a long text field you can pass the whole text field and the click-position in *start* and this routine will return the whole URL in diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 6743b2711b75..3d28e63ccf1d 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -661,7 +661,7 @@ Text I/O .. class:: TextIOBase - Base class for text streams. This class provides an unicode character + Base class for text streams. This class provides a unicode character and line based interface to stream I/O. There is no :meth:`readinto` method because Python's :class:`unicode` strings are immutable. It inherits :class:`IOBase`. There is no public constructor. diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index 6731abc4ee5e..3690d865d438 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -743,7 +743,7 @@ supports sending logging messages to a Web server, using either ``GET`` or .. method:: emit(record) - Sends the record to the Web server as an URL-encoded dictionary. The + Sends the record to the Web server as a URL-encoded dictionary. The :meth:`mapLogRecord` method is used to convert the record to the dictionary to be sent. diff --git a/Doc/library/ttk.rst b/Doc/library/ttk.rst index 051601d83e23..bf15e7122219 100644 --- a/Doc/library/ttk.rst +++ b/Doc/library/ttk.rst @@ -686,7 +686,7 @@ the widget option ``displaycolumns``. The tree widget can also display column headings. Columns may be accessed by number or symbolic names listed in the widget option columns. See `Column Identifiers`_. -Each item is identified by an unique name. The widget will generate item IDs +Each item is identified by a unique name. The widget will generate item IDs if they are not supplied by the caller. There is a distinguished root item, named ``{}``. The root item itself is not displayed; its children appear at the top level of the hierarchy. diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index 64e7099b2f0f..f74b89ff82b5 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -33,7 +33,7 @@ browsers are not available on Unix, the controlling process will launch a new browser and wait. The script :program:`webbrowser` can be used as a command-line interface for the -module. It accepts an URL as the argument. It accepts the following optional +module. It accepts a URL as the argument. It accepts the following optional parameters: ``-n`` opens the URL in a new browser window, if possible; ``-t`` opens the URL in a new browser page ("tab"). The options are, naturally, mutually exclusive. Usage example:: diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index 212a9e1e7a94..b588598772d8 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -901,7 +901,7 @@ QName Objects to get proper namespace handling on output. *text_or_uri* is a string containing the QName value, in the form {uri}local, or, if the tag argument is given, the URI part of a QName. If *tag* is given, the first argument is - interpreted as an URI, and this argument is interpreted as a local name. + interpreted as a URI, and this argument is interpreted as a local name. :class:`QName` instances are opaque. diff --git a/Doc/library/xml.sax.reader.rst b/Doc/library/xml.sax.reader.rst index 6956cd1fb301..7270153d4637 100644 --- a/Doc/library/xml.sax.reader.rst +++ b/Doc/library/xml.sax.reader.rst @@ -101,7 +101,7 @@ The :class:`XMLReader` interface supports the following methods: Process an input source, producing SAX events. The *source* object can be a system identifier (a string identifying the input source -- typically a file - name or an URL), a file-like object, or an :class:`InputSource` object. When + name or a URL), a file-like object, or an :class:`InputSource` object. When :meth:`parse` returns, the input is completely processed, and the parser object can be discarded or reset. As a limitation, the current implementation only accepts byte streams; processing of character streams is for further study. diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst index 627a282c2362..60fe5792152b 100644 --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -434,11 +434,11 @@ does not exist). It has the following attributes: error. In the following example we're going to intentionally cause a :exc:`ProtocolError` -by providing an URI that doesn't point to an XMLRPC server:: +by providing a URI that doesn't point to an XMLRPC server:: import xmlrpclib - # create a ServerProxy with an URI that doesn't respond to XMLRPC requests + # create a ServerProxy with a URI that doesn't respond to XMLRPC requests proxy = xmlrpclib.ServerProxy("http://www.google.com/") try: diff --git a/Include/stringobject.h b/Include/stringobject.h index 18b5b411aca6..12cc093c629e 100644 --- a/Include/stringobject.h +++ b/Include/stringobject.h @@ -129,7 +129,7 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedObject( /* Encodes a string object and returns the result as Python string object. - If the codec returns an Unicode object, the object is converted + If the codec returns a Unicode object, the object is converted back to a string using the default encoding. DEPRECATED - use PyString_AsEncodedObject() instead. */ @@ -152,7 +152,7 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedObject( /* Decodes a string object and returns the result as Python string object. - If the codec returns an Unicode object, the object is converted + If the codec returns a Unicode object, the object is converted back to a string using the default encoding. DEPRECATED - use PyString_AsDecodedObject() instead. */ @@ -164,7 +164,7 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedString( ); /* Provides access to the internal data buffer and size of a string - object or the default encoded version of an Unicode object. Passing + object or the default encoded version of a Unicode object. Passing NULL as *len parameter will force the string buffer to be 0-terminated (passing a string with embedded NULL characters will cause an exception). */ diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index d15ebb8df60b..9184eb100b47 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -513,7 +513,7 @@ PyAPI_FUNC(int) PyUnicode_Resize( Py_ssize_t length /* New length */ ); -/* Coerce obj to an Unicode object and return a reference with +/* Coerce obj to a Unicode object and return a reference with *incremented* refcount. Coercion is done in the following way: @@ -536,7 +536,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( const char *errors /* error handling */ ); -/* Coerce obj to an Unicode object and return a reference with +/* Coerce obj to a Unicode object and return a reference with *incremented* refcount. Unicode objects are passed back as-is (subclasses are converted to diff --git a/Lib/heapq.py b/Lib/heapq.py index 4b2c0c444110..f8269e15e407 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -56,7 +56,7 @@ representation for a tournament. The numbers below are `k', not a[k]: In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. In -an usual binary tournament we see in sports, each cell is the winner +a usual binary tournament we see in sports, each cell is the winner over the two cells it tops, and we can trace the winner down the tree to see all opponents s/he had. However, in many computer applications of such tournaments, we do not need to trace the history of a winner. diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 58951b90516a..0b85b0b9be46 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -141,7 +141,7 @@ def splitunc(p): Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. - Paths containing drive letters never have an UNC part. + Paths containing drive letters never have a UNC part. """ if p[1:2] == ':': return '', p # Drive letter present @@ -227,7 +227,7 @@ def islink(path): lexists = exists # Is a path a mount point? Either a root (with or without drive letter) -# or an UNC path with at most a / or \ after the mount point. +# or a UNC path with at most a / or \ after the mount point. def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py index 0b32d636ca83..6691b7d8b49b 100644 --- a/Lib/os2emxpath.py +++ b/Lib/os2emxpath.py @@ -62,7 +62,7 @@ def splitunc(p): Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. - Paths containing drive letters never have an UNC part. + Paths containing drive letters never have a UNC part. """ if p[1:2] == ':': return '', p # Drive letter present @@ -105,7 +105,7 @@ lexists = exists # Is a path a directory? # Is a path a mount point? Either a root (with or without drive letter) -# or an UNC path with at most a / or \ after the mount point. +# or a UNC path with at most a / or \ after the mount point. def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" diff --git a/Lib/test/test_print.py b/Lib/test/test_print.py index b7263470e2df..e8d9e6686b64 100644 --- a/Lib/test/test_print.py +++ b/Lib/test/test_print.py @@ -107,7 +107,7 @@ class TestPrint(unittest.TestCase): self.assertRaises(AttributeError, print, '', file='') def test_mixed_args(self): - # If an unicode arg is passed, sep and end should be unicode, too. + # If a unicode arg is passed, sep and end should be unicode, too. class Recorder(object): def __init__(self, must_be_unicode): diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index c8fc985cfd77..cc1340946b38 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -150,7 +150,7 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase): self.assertEqual(zlib.decompress(x), data) def test_incomplete_stream(self): - # An useful error message is given + # A useful error message is given x = zlib.compress(HAMLET_SCENE) self.assertRaisesRegexp(zlib.error, "Error -5 while decompressing data: incomplete or truncated stream", diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index c6e3d396b19d..cf6402f8c5f5 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -574,7 +574,7 @@ PI = ProcessingInstruction # @param text A string containing the QName value, in the form {uri}local, # or, if the tag argument is given, the URI part of a QName. # @param tag Optional tag. If given, the first argument is interpreted as -# an URI, and this argument is interpreted as a local name. +# a URI, and this argument is interpreted as a local name. # @return An opaque object, representing the QName. class QName(object): diff --git a/Mac/Modules/icgluemodule.c b/Mac/Modules/icgluemodule.c index 4d17bf7841f7..3a47cd04b51a 100644 --- a/Mac/Modules/icgluemodule.c +++ b/Mac/Modules/icgluemodule.c @@ -229,7 +229,7 @@ ici_ICEditPreferences(iciobject *self, PyObject *args) static char ici_ICParseURL__doc__[] = -"(hint, data, selStart, selEnd, handle)->selStart, selEnd; Find an URL, return in handle" +"(hint, data, selStart, selEnd, handle)->selStart, selEnd; Find a URL, return in handle" ; static PyObject * @@ -253,7 +253,7 @@ ici_ICParseURL(iciobject *self, PyObject *args) static char ici_ICLaunchURL__doc__[] = -"(hint, data, selStart, selEnd)->None; Find an URL and launch the correct app" +"(hint, data, selStart, selEnd)->None; Find a URL and launch the correct app" ; static PyObject * diff --git a/Misc/HISTORY b/Misc/HISTORY index b9e74da40530..60635fbb0365 100644 --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -8024,7 +8024,7 @@ Core language, builtins, and interpreter - There is a new Unicode companion to the PyObject_Str() API called PyObject_Unicode(). It behaves in the same way as the - former, but assures that the returned value is an Unicode object + former, but assures that the returned value is a Unicode object (applying the usual coercion if necessary). - The comparison operators support "rich comparison overloading" (PEP diff --git a/Misc/NEWS b/Misc/NEWS index cebb5a5aecdf..9288612dd85e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -5992,7 +5992,7 @@ Core and Builtins - Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it is set. -- Issue #1583863: An unicode subclass can now override the __unicode__ method +- Issue #1583863: A unicode subclass can now override the __unicode__ method - Issue #6474: Make error message from passing an inadequate number of keyword arguments to a function correct. @@ -6497,7 +6497,7 @@ Library when the release file is empty. - Issue #7748: Since unicode values are supported for some metadata options in - Distutils, the DistributionMetadata get_* methods will now return an utf-8 + Distutils, the DistributionMetadata get_* methods will now return a utf-8 encoded string for them. This ensures that the upload and register commands send the correct values to PyPI without any error. @@ -8873,7 +8873,7 @@ Library - Silence the DeprecationWarning raised when importing mimetools in BaseHTTPServer, cgi (and rfc822), httplib. -- Issue #2776: fixed small issue when handling an URL with double slash +- Issue #2776: fixed small issue when handling a URL with double slash after a 302 response in the case of not going through a proxy. - Issue #2676: in the email package, content-type parsing was hanging on @@ -10205,7 +10205,7 @@ Core and builtins ``object.__reduce_ex__()`` is called with an object that is faking its type. -- Patch #1680015: Don't modify __slots__ tuple if it contains an +- Patch #1680015: Don't modify __slots__ tuple if it contains a unicode name. - Patch #1444529: the builtin compile() now accepts keyword arguments. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 0d16a697a0ea..6f628a5c1444 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -2104,7 +2104,7 @@ makeuniversal(XMLParserObject* self, const char* string) /* decode universal name */ #if defined(Py_USING_UNICODE) /* inline makestring, to avoid duplicating the source string if - it's not an utf-8 string */ + it's not a utf-8 string */ p = PyString_AS_STRING(tag); if (checkstring(p, size)) { value = PyUnicode_DecodeUTF8(p, size, "strict"); diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index be301a62fc62..5b0ef691545b 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -619,7 +619,7 @@ representation for a tournament. The numbers below are `k', not a[k]:\n\ \n\ \n\ In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. In\n\ -an usual binary tournament we see in sports, each cell is the winner\n\ +a usual binary tournament we see in sports, each cell is the winner\n\ over the two cells it tops, and we can trace the winner down the tree\n\ to see all opponents s/he had. However, in many computer applications\n\ of such tournaments, we do not need to trace the history of a winner.\n\ diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 7e74607bd112..c10409826876 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -492,7 +492,7 @@ _PyCode_ConstantKey(PyObject *op) return key; } else { - /* for other types, use the object identifier as an unique identifier + /* for other types, use the object identifier as a unique identifier * to ensure that they are seen as unequal. */ PyObject *obj_id = PyLong_FromVoidPtr(op); if (obj_id == NULL) diff --git a/Python/codecs.c b/Python/codecs.c index d672362c4ce4..dbecd1dcccfc 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -334,7 +334,7 @@ PyObject *PyCodec_StreamWriter(const char *encoding, return codec_getstreamcodec(encoding, stream, errors, 3); } -/* Encode an object (e.g. an Unicode object) using the given encoding +/* Encode an object (e.g. a Unicode object) using the given encoding and return the resulting encoded object (usually a Python string). errors is passed to the encoder factory as argument if non-NULL. */ @@ -379,7 +379,7 @@ _PyCodec_EncodeInternal(PyObject *object, } /* Decode an object (usually a Python string) using the given encoding - and return an equivalent object (e.g. an Unicode object). + and return an equivalent object (e.g. a Unicode object). errors is passed to the decoder factory as argument if non-NULL. */